Commit 66dd232e7e18e12dcb96990f87a0f708e6af7992

Authored by weiliwhereareyou@163.com
1 parent 2e6a7165

增加拦截url

mobsite-getway-domain/src/main/java/com/diligrp/mobsite/getway/domain/common/RedisKey.java
@@ -22,6 +22,8 @@ public final class RedisKey { @@ -22,6 +22,8 @@ public final class RedisKey {
22 public static final String USER_DEVICEID = ZDAPP_GETWAY+":USER:DEVICEID"; 22 public static final String USER_DEVICEID = ZDAPP_GETWAY+":USER:DEVICEID";
23 public static final String USER_REGISTERNO = ZDAPP_GETWAY+":USER:REGISTERNO"; 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 public static final String GUARD_LOGININFO = ZDAPP_GETWAY+":GUARD:LOGININFO"; 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,7 +71,7 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
71 log.error("调用passport用户验证接口失败",e); 71 log.error("调用passport用户验证接口失败",e);
72 throw new ServiceException(); 72 throw new ServiceException();
73 } 73 }
74 - 74 +
75 SellerLoginResp resp = new SellerLoginResp(); 75 SellerLoginResp resp = new SellerLoginResp();
76 JSONObject jsonBody = JSONObject.parseObject(output.getData()); 76 JSONObject jsonBody = JSONObject.parseObject(output.getData());
77 int code = 0; 77 int code = 0;
@@ -81,16 +81,16 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { @@ -81,16 +81,16 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
81 log.error("passport返回数据:msg={}",jsonBody); 81 log.error("passport返回数据:msg={}",jsonBody);
82 throw new ServiceException(ResultCode.BUSINESS_FAILED,"登录失败请重新登录"); 82 throw new ServiceException(ResultCode.BUSINESS_FAILED,"登录失败请重新登录");
83 } 83 }
84 - 84 +
85 String msg = jsonBody.getString("msg"); 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 || code == PASSPORT_LOGIN_CODE_PASSWORD_WRONG) { 88 || code == PASSPORT_LOGIN_CODE_PASSWORD_WRONG) {
89 throw new ServiceException(code,msg); 89 throw new ServiceException(code,msg);
90 }else if (code != ResultCode.SUCCESS) { 90 }else if (code != ResultCode.SUCCESS) {
91 throw new ServiceException(ResultCode.BUSINESS_FAILED,msg); 91 throw new ServiceException(ResultCode.BUSINESS_FAILED,msg);
92 } 92 }
93 - 93 +
94 //resp.setToken(jsonBody.getString("token")); 94 //resp.setToken(jsonBody.getString("token"));
95 JSONObject jsonUser = jsonBody.getJSONObject("accountInfo"); 95 JSONObject jsonUser = jsonBody.getJSONObject("accountInfo");
96 resp.setSellerId(jsonUser.getLong("accountId")); 96 resp.setSellerId(jsonUser.getLong("accountId"));
@@ -106,6 +106,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC { @@ -106,6 +106,9 @@ public class PassportRPCImpl extends BaseServiceImpl implements PassportRPC {
106 String cookieRedisKey = redisUtil.makeKey(RedisKey.USER_LOGININFO, Constant.USER_ROLE_SELLER+String.valueOf(resp.getSellerId())); 106 String cookieRedisKey = redisUtil.makeKey(RedisKey.USER_LOGININFO, Constant.USER_ROLE_SELLER+String.valueOf(resp.getSellerId()));
107 redisUtil.setStringByExpire(cookieRedisKey, String.valueOf(resp.getSellerId()), loginExpireTime); 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 //缓存设备id,userId作为key 114 //缓存设备id,userId作为key
mobsite-getway-web/src/main/resources/spring-web.xml
@@ -83,10 +83,36 @@ @@ -83,10 +83,36 @@
83 <mvc:exclude-mapping path="/mobsiteApp/user/checkAuthCode"/> 83 <mvc:exclude-mapping path="/mobsiteApp/user/checkAuthCode"/>
84 <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegister"/> 84 <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegister"/>
85 <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegisters"/> 85 <mvc:exclude-mapping path="/mobsiteApp/user/buyerRegisters"/>
  86 + <mvc:exclude-mapping path="/mobsiteApp/user/loginForAuth"/>
86 <mvc:exclude-mapping path="/mobsiteApp/user/logout"/> 87 <mvc:exclude-mapping path="/mobsiteApp/user/logout"/>
87 - <mvc:exclude-mapping path="/mobsiteApp/user/loginForAuth"/>  
88 <mvc:exclude-mapping path="/mobsiteApp/user/modifyPwd"/> 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 <bean class="com.diligrp.mobsite.getway.web.filter.LoginTimeoutInterceptor"/> 116 <bean class="com.diligrp.mobsite.getway.web.filter.LoginTimeoutInterceptor"/>
91 </mvc:interceptor> 117 </mvc:interceptor>
92 <!-- <mvc:interceptor> 118 <!-- <mvc:interceptor>