ccj 3 years ago
parent
commit
f226de9b6c

+ 3 - 3
pom.xml

@@ -184,9 +184,6 @@
             <properties>
                 <env>local</env>
             </properties>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
         </profile>
         <profile>
             <id>dev</id>
@@ -205,6 +202,9 @@
             <properties>
                 <env>prod</env>
             </properties>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
 
         </profile>
     </profiles>

+ 2 - 0
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -79,6 +79,8 @@ auth:
     - /appendix/**/*
     - /noticeTask/*
     - /noticeTask/**/*
+    - /notice/*
+    - /notice/**/*
   expire-in: 36000
   login-url: /login.html
   logout-url: /auth/api/logout

+ 11 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/CommonUserController.java

@@ -199,10 +199,19 @@ public class CommonUserController {
      * @throws ServiceException
      */
     @PostMapping("/api/checkApp")
-    public String checkApp(CommonUser commonUser) throws ServiceException {
+    public String checkApp(@RequestBody CommonUser commonUser) throws ServiceException {
         return commonUserService.checkApp(commonUser);
     }
-
+    /**
+     * Session检测
+     *
+     * @return
+     * @throws ServiceException
+     */
+    @GetMapping("/api/checkSession")
+    public String checkSession() throws ServiceException {
+        return commonUserService.checkSession();
+    }
 
 
 }

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICommonUserService.java

@@ -77,4 +77,5 @@ public interface ICommonUserService extends IService<CommonUser> {
 
 
     String checkApp(CommonUser commonUser) throws ServiceException;
+    String checkSession() throws ServiceException;
 }

+ 14 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CommonUserServiceImpl.java

@@ -198,7 +198,20 @@ public class CommonUserServiceImpl extends ServiceImpl<CommonUserMapper, CommonU
         }
         return "NG";
     }
-
+    /**
+     * Session检测
+     *
+     * @return
+     * @throws ServiceException
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public String checkSession() throws ServiceException {
+        if(AuthSecurityUtils.getCurrentUserId() == null || AuthSecurityUtils.getCurrentUserId().isEmpty()){
+            return "INVALID";
+        }
+        return "VALID";
+    }
 
     /**
      * 重置密码