Commit a6289785 by 徐高华

Merge branch 'feature-haoban-role' into 'developer'

去token

See merge request !328
parents bf10282c de8fac55
package com.gic.haoban.manage.web.controller;
import com.gic.haoban.base.api.common.pojo.dto.WellDoneLoginDTO;
import com.gic.haoban.common.utils.AuthRequestWellDoneUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
......@@ -38,14 +36,4 @@ public class WebBaseController {
response.setErrorCode(errCode.getCode());
return response;
}
/**
* 获取登陆信息
*
* @return
*/
protected WellDoneLoginDTO getLoginUser() {
return AuthRequestWellDoneUtil.getLoginUser();
}
}
......@@ -229,30 +229,11 @@ public class WxEnterpriseInfoController extends WebBaseController {
*/
private RestResponse<String> wellDoneTouristsLogin(StaffLoginQO staffLoginQO, HttpServletRequest request, String staffId, String wxOpenUseId) {
logger.info("游客登录,wxOpenUseId:{}", wxOpenUseId);
Map<String, String> map = new HashMap<>();
map.put("staffId", "-1");
map.put("wxOpenUseId", wxOpenUseId);
String token = JwtUtil.genToken(map);
AuthRequestWellDoneUtil.setAppLoginUser(staffId, token);
StaffPrivacyUseLogDTO privacyUseLogDTO = new StaffPrivacyUseLogDTO();
BeanUtils.copyProperties(staffLoginQO, privacyUseLogDTO);
privacyUseLogDTO.setStaffIp(IPAddressUtil.getIpAddress(request));
wxEnterpriseApiService.wellDoneLoginAddPrivacy(privacyUseLogDTO);
return RestResponse.successResult(token);
}
/**
* 刷新token
*
* @return
*/
private String getRefreshToken() {
String refreshToken = AuthRequestWellDoneUtil.refreshToken();
if (StringUtils.isBlank(refreshToken)) {
return null;
}
return refreshToken;
return RestResponse.successResult("token");
}
/**
......@@ -274,12 +255,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
String phoneNumber = staffDTO.getPhoneNumber();
Map<String, String> map = new HashMap<>();
map.put("staffId", staffId);
map.put("wxEnterpriseId", staffDTO.getWxEnterpriseId());
map.put("phoneNumber", phoneNumber);
String token = JwtUtil.genToken(map);
AuthRequestWellDoneUtil.setAppLoginUser(staffId, token);
StaffPrivacyUseLogDTO privacyUseLogDTO = new StaffPrivacyUseLogDTO();
BeanUtils.copyProperties(staffLoginQO, privacyUseLogDTO);
privacyUseLogDTO.setStaffIp(IPAddressUtil.getIpAddress(request));
......@@ -288,7 +263,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
privacyUseLogDTO.setWxUserId(staffDTO.getWxUserId());
privacyUseLogDTO.setWxOpenUseId(staffDTO.getWxOpenUseId());
wxEnterpriseApiService.wellDoneLoginAddPrivacy(privacyUseLogDTO);
return RestResponse.successResult(token);
return RestResponse.successResult("token");
}
/**
......@@ -300,22 +275,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
*/
@RequestMapping(value = "welldone-token-refresh", method = RequestMethod.GET)
public HaobanResponse welldoneTokenRefresh() {
String refreshToken = getRefreshToken();
if (StringUtils.isBlank(refreshToken)) {
return resultResponse(HaoBanErrCode.ERR_30010);
}
return resultResponse(HaoBanErrCode.ERR_1, refreshToken);
}
/**
* 好办小程序-登出
*
* @return
*/
@RequestMapping(value = "welldone-loginout", method = RequestMethod.GET)
public RestResponse welldoneLoginOut() {
AuthRequestWellDoneUtil.delToken();
return RestResponse.successResult();
return resultResponse(HaoBanErrCode.ERR_1, null);
}
/**
......
......@@ -4,7 +4,6 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:interceptors>
<bean class="com.gic.commons.interceptor.HeaderTagInterceptor"/>
<bean class="com.gic.haoban.manage.web.utils.LogInterceptor"/>
<bean class="com.gic.haoban.common.interceptor.HttpLimitInterceptor"/>
<bean class="com.gic.haoban.common.ext.PropertyViewClearInterceptor"/>
<mvc:interceptor>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment