Преглед изворни кода

fix 设置限制登录状态

tjf пре 3 година
родитељ
комит
c8f6045993

+ 2 - 1
boman-auth/src/main/resources/bootstrap-prod.yml

@@ -1,7 +1,8 @@
 # Tomcat
 server: 
   port: 6200
-
+#是否限制登录
+upkeep: false
 # Spring
 spring: 
   application:

+ 7 - 0
boman-wechat/src/main/java/com/boman/wechat/controller/AppletLoginController.java

@@ -25,6 +25,7 @@ import com.boman.system.api.model.LoginUser;
 import com.boman.wechat.utils.WxCodeSessionUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -64,8 +65,14 @@ public class AppletLoginController {
     @Resource
     private RemoteDeptService remoteDeptService;
 
+    @Value("${upkeep}")
+    private Boolean upKeep;
+
     @PostMapping("/login")
     public R<Map<String, Object>> getPhone(@RequestBody AppletLoginForm form) {
+        if (upKeep){
+            throw new BaseException("当前正在维护");
+        }
         AppletSessionDTO dto = codeUtil.jscode2Session(form);
         String phoneNumber = dto.getPhoneNumber();
         if (StringUtils.isBlank(phoneNumber)){

+ 2 - 1
boman-wechat/src/main/resources/bootstrap-prod.yml

@@ -1,6 +1,7 @@
 server:
   port: 8124
-
+#是否限制登录
+upkeep: false
 spring:
   application:
     name: boman-wechat