Browse Source

7.28 修正无法获取当前登录对象问题

Mechrevo 1 năm trước cách đây
mục cha
commit
7085fc2c4f

+ 1 - 2
sp-core/sp-base/src/main/java/com/pj/current/satoken/StpAPPUserUtil.java

@@ -7,7 +7,6 @@ import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
 import com.pj.current.dto.APPLoginUserInfo;
-import com.pj.current.dto.PCLoginUserInfo;
 import com.pj.utils.cache.RedisUtil;
 import org.springframework.stereotype.Component;
 
@@ -65,7 +64,7 @@ public class StpAPPUserUtil {
     public static APPLoginUserInfo getAPPLoginInfo(){
         String key="app:"+stpLogic.getLoginIdAsString();
         String info=RedisUtil.get(key);
-        return StrUtil.isNotEmpty(info)?new APPLoginUserInfo():JSONUtil.toBean(info,APPLoginUserInfo.class);
+        return StrUtil.isEmpty(info)?new APPLoginUserInfo():JSONUtil.toBean(info,APPLoginUserInfo.class);
     }
 
 

+ 1 - 1
sp-core/sp-base/src/main/java/com/pj/current/satoken/StpUserUtil.java

@@ -52,7 +52,7 @@ public class StpUserUtil {
     public static PCLoginUserInfo getPCLoginInfo(){
         String key="pc:"+getLoginIdAsString();
         String info=RedisUtil.get(key);
-        return StrUtil.isNotEmpty(info)?new PCLoginUserInfo():JSONUtil.toBean(info,PCLoginUserInfo.class);
+        return StrUtil.isEmpty(info)?new PCLoginUserInfo():JSONUtil.toBean(info,PCLoginUserInfo.class);
     }
 
 

+ 2 - 2
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseService.java

@@ -148,7 +148,7 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
 		//创建时间
 		enterprise.setCreateTime(new Date());
 		//删除状态:启用
-		enterprise.setDeleteStatus(1);
+		enterprise.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
 
 		// 保存商家信息
 		int insert = tbEnterpriseMapper.insert(enterprise);
@@ -164,7 +164,7 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
 
 		//获取当前登录用户
 		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-		if(appLoginInfo == null)throw new RuntimeException("当前登陆用户信息已失效!");
+		if(appLoginInfo.getLoginId() == null)throw new RuntimeException("当前登陆用户信息已失效!");
 		Long loginId = appLoginInfo.getLoginId();
 		//仅能查询自己的订单
 		so.set("buy_user_id",loginId);

+ 0 - 3
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.xml

@@ -11,9 +11,6 @@
 	<!-- 通用映射:自动模式 -->
 	<resultMap id="model" autoMapping="true" type="com.pj.tb_order.TbOrder"></resultMap>
 
-	<select id="selectOrderListVo" resultMap="">
-
-	</select>