Commit 66dd232e7e18e12dcb96990f87a0f708e6af7992
1 parent
2e6a7165
增加拦截url
Showing
3 changed files
with
37 additions
and
6 deletions
mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/common/RedisKey.java
... | ... | @@ -22,6 +22,8 @@ public final class RedisKey { |
22 | 22 | public static final String USER_DEVICEID = ZDAPP_GETWAY+":USER:DEVICEID"; |
23 | 23 | public static final String USER_REGISTERNO = ZDAPP_GETWAY+":USER:REGISTERNO"; |
24 | 24 | |
25 | + public static final String USER_SHOPID = ZDAPP_GETWAY+":USER:SHOPID"; | |
26 | + | |
25 | 27 | //门卫登录信息 |
26 | 28 | public static final String GUARD_LOGININFO = ZDAPP_GETWAY+":GUARD:LOGININFO"; |
27 | 29 | ... | ... |
mobsite-getway-rpc/src/main/java/com/diligrp/mobsite/getway/rpc/impl/PassportRPCImpl.java
... | ... | @@ -71,7 +71,7 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { |
71 | 71 | log.error("调用passport用户验证接口失败",e); |
72 | 72 | throw new ServiceException(); |
73 | 73 | } |
74 | - | |
74 | + | |
75 | 75 | SellerLoginResp resp = new SellerLoginResp(); |
76 | 76 | JSONObject jsonBody = JSONObject.parseObject(output.getData()); |
77 | 77 | int code = 0; |
... | ... | @@ -81,16 +81,16 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { |
81 | 81 | log.error("passport返回数据:msg={}",jsonBody); |
82 | 82 | throw new ServiceException(ResultCode.BUSINESS_FAILED,"登录失败请重新登录"); |
83 | 83 | } |
84 | - | |
84 | + | |
85 | 85 | String msg = jsonBody.getString("msg"); |
86 | - | |
87 | - if (code == PASSPORT_LOGIN_CODE_LOCKED || code == PASSPORT_LOGIN_CODE_ACCOUNT_NOT_EXIST | |
86 | + | |
87 | + if (code == PASSPORT_LOGIN_CODE_LOCKED || code == PASSPORT_LOGIN_CODE_ACCOUNT_NOT_EXIST | |
88 | 88 | || code == PASSPORT_LOGIN_CODE_PASSWORD_WRONG) { |
89 | 89 | throw new ServiceException(code,msg); |
90 | 90 | }else if (code != ResultCode.SUCCESS) { |
91 | 91 | throw new ServiceException(ResultCode.BUSINESS_FAILED,msg); |
92 | 92 | } |
93 | - | |
93 | + | |
94 | 94 | //resp.setToken(jsonBody.getString("token")); |
95 | 95 | JSONObject jsonUser = jsonBody.getJSONObject("accountInfo"); |
96 | 96 | resp.setSellerId(jsonUser.getLong("accountId")); |
... | ... | @@ -106,6 +106,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { |
106 | 106 | String cookieRedisKey = redisUtil.makeKey(RedisKey.USER_LOGININFO, Constant.USER_ROLE_SELLER+String.valueOf(resp.getSellerId())); |
107 | 107 | redisUtil.setStringByExpire(cookieRedisKey, String.valueOf(resp.getSellerId()), loginExpireTime); |
108 | 108 | |
109 | + //缓存shopId | |
110 | + String shopIdKey = redisUtil.makeKey(RedisKey.USER_SHOPID, Constant.USER_ROLE_SELLER+String.valueOf(resp.getSellerId())); | |
111 | + redisUtil.setStringByExpire(shopIdKey, String.valueOf(resp.getShopId()), loginExpireTime); | |
109 | 112 | |
110 | 113 | |
111 | 114 | //缓存设备id,userId作为key | ... | ... |
mobsite-getway-web/src/main/resources/spring-web.xml
... | ... | @@ -83,10 +83,36 @@ |
83 | 83 | <mvc:exclude-mapping path="/mobsiteApp/user/checkAuthCode"/> |
84 | 84 | <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegister"/> |
85 | 85 | <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegisters"/> |
86 | + <mvc:exclude-mapping path="/mobsiteApp/user/loginForAuth"/> | |
86 | 87 | <mvc:exclude-mapping path="/mobsiteApp/user/logout"/> |
87 | - <mvc:exclude-mapping path="/mobsiteApp/user/loginForAuth"/> | |
88 | 88 | <mvc:exclude-mapping path="/mobsiteApp/user/modifyPwd"/> |
89 | 89 | |
90 | + <mvc:exclude-mapping path="/mobsiteApp/goods/getProductByCid"/> | |
91 | + <mvc:exclude-mapping path="/mobsiteApp/goods/getProductCategory"/> | |
92 | + <mvc:exclude-mapping path="/mobsiteApp/goods/getProductIntroduction"/> | |
93 | + <mvc:exclude-mapping path="/mobsiteApp/goods/searchGoodList"/> | |
94 | + <mvc:exclude-mapping path="/mobsiteApp/meal/getMealList"/> | |
95 | + <mvc:exclude-mapping path="/mobsiteApp/meal/getMealById"/> | |
96 | + <mvc:exclude-mapping path="/mobsiteApp/shop/getProductRecommend"/> | |
97 | + <mvc:exclude-mapping path="/mobsiteApp/topic/getHomeStatisticsTopic"/> | |
98 | + <mvc:exclude-mapping path="/mobsiteApp/topic/getPicInfo"/> | |
99 | + <mvc:exclude-mapping path="/mobsiteApp/common/getAllCountryTree"/> | |
100 | + <mvc:exclude-mapping path="/mobsiteApp/common/getCity"/> | |
101 | + <mvc:exclude-mapping path="/mobsiteApp/common/getCitys"/> | |
102 | + <mvc:exclude-mapping path="/mobsiteApp/common/getCountry"/> | |
103 | + <mvc:exclude-mapping path="/mobsiteApp/common/uploadImg"/> | |
104 | + | |
105 | + <!--卖家--> | |
106 | + | |
107 | + <mvc:exclude-mapping path="/mobsiteApp/user/buyerLogin"/> | |
108 | + <mvc:exclude-mapping path="/mobsiteApp/user/buyerLogins"/> | |
109 | + <mvc:exclude-mapping path="/mobsiteApp/user/sendAuthCode"/> | |
110 | + <mvc:exclude-mapping path="/mobsiteApp/user/checkAuthCode"/> | |
111 | + <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegister"/> | |
112 | + <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegisters"/> | |
113 | + <mvc:exclude-mapping path="/mobsiteApp/user/loginForAuth"/> | |
114 | + <mvc:exclude-mapping path="/mobsiteApp/user/logout"/> | |
115 | + <mvc:exclude-mapping path="/mobsiteApp/user/modifyPwd"/> | |
90 | 116 | <bean class="com.diligrp.mobsite.getway.web.filter.LoginTimeoutInterceptor"/> |
91 | 117 | </mvc:interceptor> |
92 | 118 | <!-- <mvc:interceptor> | ... | ... |