Просмотр исходного кода

优化 & 全部做生产环境

marxjaw 4 месяцев назад
Родитель
Сommit
ba892f6472

+ 35 - 0
yt-advertise/advertise-service/src/main/resources/bootstrap.yml

@@ -0,0 +1,35 @@
+spring:
+  profiles:
+    active: dev
+---
+spring:
+  profiles: local
+  main:
+    allow-bean-definition-overriding: true
+  application:
+    name: advertise-service
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848
+        namespace: 52439154-ea03-4121-9759-44d0cacc4765
+      config:
+        server-addr: 127.0.0.1:8848
+        file-extension: yml
+        namespace: 52439154-ea03-4121-9759-44d0cacc4765
+---
+spring:
+  profiles: dev
+  main:
+    allow-bean-definition-overriding: true
+  application:
+    name: advertise-service
+  cloud:
+    nacos:
+      discovery:
+        server-addr: 127.0.0.1:8848
+        namespace: ad14a1aa-fe06-473a-9050-9afa26ec0020
+      config:
+        server-addr: 127.0.0.1:8848
+        file-extension: yml
+        namespace: ad14a1aa-fe06-473a-9050-9afa26ec0020

+ 1 - 1
yt-agent/agent-service/src/main/resources/bootstrap.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: local
+    active: dev
 ---
 spring:
   profiles: local

+ 7 - 7
yt-app/app-service/src/main/java/com/ytpm/controller/WxController.java

@@ -89,7 +89,12 @@ public class WxController {
         }
         //处理用户注册或登录更新信息
         YtDyzUser old = appUserMapper.getYtAppUser(loginResult.getOpenid());
-        deadWithUserCrud(old,wxUserInfo,param,loginResult);
+        if(Objects.isNull(old)) {
+            old = new YtDyzUser();
+            registryUser(param,wxUserInfo,loginResult, old);
+        }else{
+            deadWithUserCrud(old,wxUserInfo,param);
+        }
         // 添加用户登录记录
         addLoginRecord(param,openid);
         //TODO 返回数据前校验当前应用的风控规则
@@ -103,8 +108,7 @@ public class WxController {
     /**
      * 处理用户数据
      */
-    private void deadWithUserCrud(YtDyzUser old, WxUserInfo wxUserInfo, WxLoginParam param,WxLoginResult loginResult) {
-        if(Objects.nonNull(old)){
+    private void deadWithUserCrud(YtDyzUser old, WxUserInfo wxUserInfo, WxLoginParam param) {
             //处于风控状态的用户不允许登录
             if(!old.getUserStatus().equals(UserStatusEnum.NORMAL.getCode())){
                 throw new CustomerException("当前用户处于"+UserStatusEnum.getByCode(old.getUserStatus())+"中,无法登录");
@@ -117,10 +121,6 @@ public class WxController {
             newUser.setLastLoginIp(param.getLoginIp());
             newUser.setLoginDays(old.getLoginDays()+1);
             appUserMapper.updateUser(newUser);
-        }else{
-            old = new YtDyzUser();
-            registryUser(param,wxUserInfo,loginResult, old);
-        }
     }
 
     /**

+ 1 - 1
yt-app/app-service/src/main/resources/bootstrap.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: local
+    active: dev
 ---
 spring:
   profiles: local

+ 1 - 1
yt-gateway/src/main/resources/bootstrap.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: local
+    active: dev
 ---
 spring:
   profiles: local

+ 1 - 1
yt-oauth/oauth-service/src/main/resources/bootstrap.yml

@@ -1,6 +1,6 @@
 spring:
   profiles:
-    active: local
+    active: dev
 ---
 spring:
   profiles: local