Browse Source

http://192.168.0.21/index.php?m=bug&f=view&bugID=28066

lyhzzz 3 years ago
parent
commit
1d53f7a33f

+ 1 - 0
src/main/java/com/cdf/controller/back/LoginController.java

@@ -4,6 +4,7 @@ import com.cdf.aop.SysLog;
 import com.cdf.business.LoginService;
 import com.cdf.common.ResultData;
 import com.cdf.request.LoginRequest;
+import com.cdf.util.JwtUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 

+ 6 - 0
src/main/java/com/cdf/httpClient/client/FdkkClient.java

@@ -31,6 +31,12 @@ public interface FdkkClient {
     @Address(source = FdkkLoginAddressSource.class)
     FdkkResponse sceneList(@JSONBody FdkkSceneListRequest fdkkSceneRequest , @Header("token")  String token);
     /**
+     * 获取场景列表
+     */
+    @Post("/api/user/scene/getOnlySceneList")
+    @Address(source = FdkkLoginAddressSource.class)
+    FdkkResponse getOnlySceneList(@JSONBody FdkkSceneListRequest fdkkSceneRequest , @Header("token")  String token);
+    /**
      * 删除场景
      */
     @Post("/api/user/scene/delete")

+ 7 - 1
src/main/java/com/cdf/service/impl/FdkkSceneService.java

@@ -14,6 +14,7 @@ import com.cdf.service.IUserService;
 import com.cdf.util.Base64Converter;
 import com.cdf.util.JwtUtil;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -57,7 +58,12 @@ public class FdkkSceneService {
 
 
     public PageInfo list(FdkkSceneListRequest param, String token){
-        FdkkResponse fdkkResponse = fdkkClient.sceneList(param, getFdkkToken(token));
+        FdkkResponse fdkkResponse;
+        if(StringUtils.isBlank(param.getSearchKey())){
+             fdkkResponse = fdkkClient.sceneList(param, getFdkkToken(token));
+        }else {
+             fdkkResponse = fdkkClient.getOnlySceneList(param, getFdkkToken(token));
+        }
         if(fdkkResponse.getCode() != ResultCode.SUCCESS.code){
             throw new BusinessException(fdkkResponse.getCode(),fdkkResponse.getMsg());
         }

+ 1 - 1
src/main/java/com/cdf/util/JwtUtil.java

@@ -25,7 +25,7 @@ public class JwtUtil {
      * @param map      登录成功的user对象
      * @return
      */
-    public static String createJWT(long ttlMillis, Map<String, Object> map) {
+    public synchronized static String createJWT(long ttlMillis, Map<String, Object> map) {
         //指定签名的时候使用的签名算法,也就是header那部分,jjwt已经将这部分内容封装好了。
         SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256;