From 6692800851e643f2a58decb9d77ee27f133684b3 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期一, 29 九月 2025 18:03:38 +0800
Subject: [PATCH] 最新版本541200007
---
server/system_service/src/main/java/com/doumee/api/BaseController.java | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/server/system_service/src/main/java/com/doumee/api/BaseController.java b/server/system_service/src/main/java/com/doumee/api/BaseController.java
index b19a5e9..ffe898e 100644
--- a/server/system_service/src/main/java/com/doumee/api/BaseController.java
+++ b/server/system_service/src/main/java/com/doumee/api/BaseController.java
@@ -1,9 +1,10 @@
package com.doumee.api;
import com.alibaba.fastjson.JSONObject;
+import com.doumee.config.jwt.JwtTokenUtil;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
-import com.doumee.core.model.LoginUserInfo;
+import com.doumee.service.business.third.model.LoginUserInfo;
import com.doumee.core.utils.Constants;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@@ -32,17 +33,10 @@
* @author Eva.Caesar Liu
* @date 2023/03/21 14:49
*/
- protected LoginUserInfo getLoginUser () {
- return (LoginUserInfo)SecurityUtils.getSubject().getPrincipal();
- }
- /**
- * 鑾峰彇褰撳墠鐧诲綍鐢ㄦ埛
- * @author Eva.Caesar Liu
- * @date 2023/03/21 14:49
- */
- protected LoginUserInfo getLoginUser (String token) {
+ public LoginUserInfo getLoginUser (String token) {
if (token == null || token.isEmpty()) {
- throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"鏈櫥褰�");
+ return (LoginUserInfo)SecurityUtils.getSubject().getPrincipal();
+// throw new BusinessException(ResponseStatus.NO_LOGIN.getCode(),"鏈櫥褰�");
}
String userinfo =(String) stringRedisTemplate.opsForValue().get(Constants.REDIS_TOKEN_KEY + token);
if (StringUtils.isBlank(userinfo)) {
@@ -67,10 +61,17 @@
}
public List<Integer> getIdList(String ids){
+ if(StringUtils.isBlank(ids)){
+ return null;
+ }
String [] idArray = ids.split(",");
List<Integer> idList = new ArrayList<>();
for (String id : idArray) {
- idList.add(Integer.valueOf(id));
+ try {
+ idList.add(Integer.valueOf(id));
+ }catch (Exception e){
+
+ }
}
return idList;
}
--
Gitblit v1.9.3