Explorar el Código

登录跳转问题

qzyReal hace 2 años
padre
commit
96386c2619

+ 1 - 1
sp-core/src/main/java/com/pj/project/tb_mini_user/TbMiniUserService.java

@@ -94,7 +94,7 @@ public class TbMiniUserService extends ServiceImpl<TbMiniUserMapper, TbMiniUser>
     public AjaxJson loginByOpenid(String openid,Integer type) {
         TbMiniUser tbMiniUser = this.findByOpenid(openid,type);
         if (tbMiniUser == null) {
-            return AjaxJson.getError("用户不存在");
+            return AjaxJson.getError(AjaxJson.ERROR_ENTER_PORT,"请更换入口");
         }
         tbMiniUser.setLastLoginTime(new Date());
         this.updateById(tbMiniUser);

+ 4 - 0
sp-core/src/main/java/com/pj/utils/sg/AjaxJson.java

@@ -37,6 +37,7 @@ public class AjaxJson extends LinkedHashMap<String, Object> implements Serializa
 	public static final int CODE_WARNING = 501;			// 警告状态码
 	public static final int CODE_NOT_JUR = 403;			// 无权限状态码
 	public static final int CODE_NOT_LOGIN = 401;		// 未登录状态码
+	public static final int ERROR_ENTER_PORT = 405;		// 未登录状态码
 	public static final int CODE_INVALID_REQUEST = 400;	// 无效请求状态码
 
 	
@@ -168,6 +169,9 @@ public class AjaxJson extends LinkedHashMap<String, Object> implements Serializa
 	public static AjaxJson getError(String msg) {
 		return new AjaxJson(CODE_ERROR, msg, null, null);
 	}
+	public static AjaxJson getError(int code,String msg) {
+		return new AjaxJson(code, msg, null, null);
+	}
 	
 	/** 返回警告  */
 	public static AjaxJson getWarning() {

+ 6 - 6
sp-start/src/main/resources/application-dev.yml

@@ -7,9 +7,9 @@ spring:
     # 数据源配置
     datasource: 
         type: com.alibaba.druid.pool.DruidDataSource
-        url: jdbc:mysql://127.0.0.1:3307/smart_face?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
+        url: jdbc:mysql://127.0.0.1:3306/smart_face?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=GMT%2B8
         username: root
-        password: 1234
+        password: 123456
         # 是否打开sql监控台  (生产环境请务必关闭此选项) 
         druid: 
             stat-view-servlet:
@@ -57,10 +57,10 @@ spring:
         limit-user-count: 45000
 wx:
     enable: true
-#    app-id: wxd40a34141872bf0c
-#    app-secret: 2e6a69fab1fbab60369ebd21b0882f3e
-    app-id: wx4979e287cbed0d86
-    app-secret: 0f2c93b93615b768c6423651ab536ddb
+    app-id: wxd40a34141872bf0c
+    app-secret: 2e6a69fab1fbab60369ebd21b0882f3e
+  #  app-id: wx4979e287cbed0d86
+   # app-secret: 0f2c93b93615b768c6423651ab536ddb
     access-token-key: wechat:base_token_key
     js-api-ticket-key: wechat:jsapi_ticket_key
     access-token-url: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=${wx.app-id}&secret=${wx.app-secret}