| | |
| | | import java.io.Serializable; |
| | | |
| | | public class UserAttrDto extends PageDto implements Serializable { |
| | | |
| | | public static final String SPEC_KEY = "100202061602";//用户临时key |
| | | |
| | | public static final String SPEC_OPEN_ID = "100201911001";//用户微信OPENID |
| | | |
| | | private String attrId; |
| | | private String userId; |
| | | private String specCd; |
| | |
| | | private String openId; |
| | | private String statusCd; |
| | | |
| | | private String token; |
| | | |
| | | private String key;//临时登录秘钥,每次登录后重置 |
| | | |
| | | |
| | | private String parentOrgName; |
| | | |
| | |
| | | public void setBelongCommunityId(String belongCommunityId) { |
| | | this.belongCommunityId = belongCommunityId; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getToken() { |
| | | return token; |
| | | } |
| | | |
| | | public void setToken(String token) { |
| | | this.token = token; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 创建ResponseEntity对象 |
| | | * |
| | | * @param code 状态嘛 |
| | | * @param msg 返回信息 |
| | | * @return |
| | | */ |
| | | public static ResponseEntity<String> createResponseEntity(int code, String msg) { |
| | | ResultVo resultVo = new ResultVo(code, msg); |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | return responseEntity; |
| | | } |
| | | |
| | | /** |
| | | * 创建ResponseEntity对象 |
| | | * |
| | | * @param records 页数 |
| | | * @param total 总记录数 |
| | | * @param code 状态嘛 |
| | |
| | | |
| | | private String openId; |
| | | |
| | | private String key; |
| | | |
| | | private int age; |
| | | |
| | | private String sex; |
| | |
| | | public void setOpenId(String openId) { |
| | | this.openId = openId; |
| | | } |
| | | |
| | | public String getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(String key) { |
| | | this.key = key; |
| | | } |
| | | } |
| | |
| | | <if test="openId != null and openId !=''"> |
| | | ,u_user_attr ua |
| | | </if> |
| | | <if test="key != null and key !=''"> |
| | | ,u_user_attr ub |
| | | </if> |
| | | where 1= 1 |
| | | <if test="openId != null and openId != ''"> |
| | | and u.user_id = ua.user_id |
| | |
| | | and ua.value = #{openId} |
| | | and ua.status_cd = '0' |
| | | </if> |
| | | <if test="key != null and key != ''"> |
| | | and u.user_id = ua.user_id |
| | | and ub.spec_cd = '100202061602' |
| | | and ub.value = #{key} |
| | | and ub.status_cd = '0' |
| | | </if> |
| | | <if test="bId != null and bId !=''"> |
| | | and u.b_id = #{bId} |
| | | </if> |
| | |
| | | |
| | | |
| | | /** |
| | | * 查询 组织管理 |
| | | * 查询 用户私密信息 |
| | | */ |
| | | public static final String QUERY_USER_SECRET = "user.queryUserSecret"; |
| | | |
| | | /** |
| | | * 查询 用户 |
| | | */ |
| | | public static final String LIST_USERS = "user.listUsers"; |
| | | |
| | |
| | | public static final String SERVICE_CODE_USER_SERVICE_LOGIN = "user.service.login"; |
| | | |
| | | /** |
| | | * 用户登录服务处理 |
| | | */ |
| | | public static final String SERVICE_CODE_USER_LOGIN = "user.userLogin"; |
| | | |
| | | /** |
| | | * 用户退出登录服务处理 |
| | | */ |
| | | public static final String SERVICE_CODE_USER_SERVICE_LOGOUT = "user.service.logout"; |
| | |
| | | List<ApiUserDataVo> users = null; |
| | | |
| | | if (count > 0) { |
| | | users = BeanConvertUtil.covertBeanList(userInnerServiceSMOImpl.getUsers(userDto), ApiUserDataVo.class); |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto); |
| | | users = BeanConvertUtil.covertBeanList(userDtos, ApiUserDataVo.class); |
| | | } else { |
| | | users = new ArrayList<>(); |
| | | } |
| | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiOrgVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.user.UserAttrDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 这个类专门查询用户秘钥信息 |
| | | */ |
| | | @Java110Listener("queryUserSecretListener") |
| | | public class QueryUserSecretListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.QUERY_USER_SECRET; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //super.validatePageInfo(reqJson); |
| | | Assert.hasKeyAndValue(reqJson, "userId", "请求报文中未包含用户ID"); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | ResponseEntity<String> responseEntity = null; |
| | | UserDto userDto = BeanConvertUtil.covertBean(reqJson, UserDto.class); |
| | | |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto); |
| | | |
| | | if (userDtos == null || userDtos.size() < 1) { |
| | | responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "未找到用户信息"); |
| | | context.setResponseEntity(responseEntity); |
| | | return; |
| | | } |
| | | |
| | | userDto = userDtos.get(0); |
| | | List<UserAttrDto> userAttrDtos = userDto.getUserAttrs(); |
| | | String key = ""; |
| | | String openId = ""; |
| | | for (UserAttrDto userAttrDto : userAttrDtos) { |
| | | if (UserAttrDto.SPEC_KEY.equals(userAttrDto.getSpecCd())) { |
| | | key = userAttrDto.getValue(); |
| | | } |
| | | |
| | | if (UserAttrDto.SPEC_OPEN_ID.equals(userAttrDto.getSpecCd())) { |
| | | openId = userAttrDto.getValue(); |
| | | } |
| | | } |
| | | userDto.setKey(key); |
| | | userDto.setOpenId(openId); |
| | | responseEntity = ResultVo.createResponseEntity(ResultVo.CODE_OK, "成功", userDto); |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.user; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiPlusListener; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.user.UserAttrDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.po.userAttr.UserAttrPo; |
| | | import com.java110.utils.constant.BusinessTypeConstant; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.ValidatorUtil; |
| | | import com.java110.vo.ResultVo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 用户注册 侦听 |
| | | * Created by wuxw on 2018/5/18. |
| | | */ |
| | | @Java110Listener("userLoginListener") |
| | | public class UserLoginListener extends AbstractServiceApiPlusListener { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(UserLoginListener.class); |
| | | |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_USER_LOGIN; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | //1.0 优先用 手机号登录 |
| | | UserDto userDto = new UserDto(); |
| | | String errorInfo = ""; |
| | | if (reqJson.containsKey("userName")) { |
| | | if (!ValidatorUtil.isMobile(reqJson.getString("userName"))) {//用户临时秘钥登录 |
| | | userDto.setTel(reqJson.getString("userName")); |
| | | } else { |
| | | userDto.setUserName(reqJson.getString("userName")); |
| | | } |
| | | userDto.setPassword(AuthenticationFactory.passwdMd5(reqJson.getString("passwd"))); |
| | | errorInfo = "用户名或密码错误"; |
| | | } else { |
| | | userDto.setKey(reqJson.getString("key")); |
| | | errorInfo = "临时票据错误"; |
| | | } |
| | | |
| | | List<UserDto> userDtos = userInnerServiceSMOImpl.getUsers(userDto); |
| | | |
| | | if (userDtos == null || userDtos.size() < 1) { |
| | | throw new SMOException("登录失败," + errorInfo); |
| | | } |
| | | |
| | | //表名登录成功 |
| | | UserDto tmpUserDto = userDtos.get(0); |
| | | |
| | | List<UserAttrDto> userAttrDtos = tmpUserDto.getUserAttrs(); |
| | | |
| | | UserAttrDto userAttrDto = getCurrentUserAttrDto(userAttrDtos, UserAttrDto.SPEC_KEY); |
| | | String newKey = UUID.randomUUID().toString(); |
| | | if (userAttrDto != null) { |
| | | UserAttrPo userAttrPo = BeanConvertUtil.covertBean(userAttrDto, UserAttrPo.class); |
| | | userAttrPo.setValue(newKey); |
| | | super.update(context, userAttrPo, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_USER_ATTR_INFO); |
| | | } else { |
| | | UserAttrPo userAttrPo = new UserAttrPo(); |
| | | userAttrPo.setAttrId("-1"); |
| | | userAttrPo.setUserId(tmpUserDto.getUserId()); |
| | | userAttrPo.setSpecCd(UserAttrDto.SPEC_KEY); |
| | | userAttrPo.setValue(newKey); |
| | | super.insert(context, userAttrPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_ATTR_INFO); |
| | | } |
| | | |
| | | |
| | | try { |
| | | Map userMap = new HashMap(); |
| | | userMap.put(CommonConstant.LOGIN_USER_ID, tmpUserDto.getUserId()); |
| | | userMap.put(CommonConstant.LOGIN_USER_NAME, tmpUserDto.getUserName()); |
| | | String token = AuthenticationFactory.createAndSaveToken(userMap); |
| | | tmpUserDto.setPassword(""); |
| | | tmpUserDto.setToken(token); |
| | | context.setResponseEntity(ResultVo.createResponseEntity(tmpUserDto)); |
| | | } catch (Exception e) { |
| | | logger.error("登录异常:", e); |
| | | throw new SMOException(ResponseConstant.RESULT_CODE_INNER_ERROR, "系统内部错误,请联系管理员"); |
| | | } |
| | | } |
| | | |
| | | private UserAttrDto getCurrentUserAttrDto(List<UserAttrDto> userAttrDtos, String specCd) { |
| | | for (UserAttrDto userAttrDto : userAttrDtos) { |
| | | if (specCd.equals(userAttrDto.getSpecCd())) { |
| | | return userAttrDto; |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 对请求报文处理 |
| | | * |
| | | * @param paramIn |
| | | * @return |
| | | */ |
| | | private JSONObject refreshParamIn(String paramIn) { |
| | | JSONObject paramObj = JSONObject.parseObject(paramIn); |
| | | paramObj.put("userId", "-1"); |
| | | paramObj.put("levelCd", "0"); |
| | | |
| | | return paramObj; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | exclusions.append("/app/loginWx,");// 登录跳过 |
| | | exclusions.append("/app/loginProperty,");// 物业APP登录跳过 |
| | | exclusions.append("/app/loginOwner,");// 业主APP登录跳过 |
| | | exclusions.append("/app/loginOwnerByKey,");// 根据key登录业主 |
| | | exclusions.append("/app/area.listAreas,");// 加载地区 |
| | | exclusions.append("/app/community.listCommunitys,");// 加载小区 |
| | | exclusions.append("/app/user.userSendSms,");// 发送短信验证码 |
| | |
| | | exclusions.append("/app/wechat/gateway,");//微信公众号对接接口 |
| | | exclusions.append("/app/loginOwnerWechatAuth,");//微信公众号对接接口 |
| | | exclusions.append("/app/refreshToken");//微信公众号对接接口 |
| | | |
| | | final FilterRegistrationBean registrationBean = new FilterRegistrationBean(); |
| | | registrationBean.setFilter(new JwtFilter()); |
| | | registrationBean.addUrlPatterns("/"); |
| | |
| | | return responseEntity; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信登录接口 |
| | | * |
| | | * @param postInfo |
| | | * @param request |
| | | */ |
| | | @RequestMapping(path = "/loginOwnerByKey", method = RequestMethod.POST) |
| | | public ResponseEntity<String> loginOwnerByKey(@RequestBody String postInfo, HttpServletRequest request) { |
| | | /*IPageData pd = (IPageData) request.getAttribute(CommonConstant.CONTEXT_PAGE_DATA);*/ |
| | | String appId = request.getHeader("APP_ID"); |
| | | if(StringUtil.isEmpty(appId)){ |
| | | appId = request.getHeader("APP-ID"); |
| | | } |
| | | IPageData pd = PageData.newInstance().builder("", "", "", postInfo, |
| | | "login", "", "", "", appId |
| | | ); |
| | | ResponseEntity<String> responseEntity = ownerAppLoginSMOImpl.doLoginByKey(pd); |
| | | if (responseEntity.getStatusCode() != HttpStatus.OK) { |
| | | return responseEntity; |
| | | } |
| | | JSONObject outParam = JSONObject.parseObject(responseEntity.getBody()); |
| | | pd.setToken(outParam.getString("token")); |
| | | request.setAttribute(CommonConstant.CONTEXT_PAGE_DATA, pd); |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | @RequestMapping(path = "/refreshToken") |
| | | public ResponseEntity<String> refreshToken(@RequestParam String redirectUrl, |
| | | @RequestParam String errorUrl, |
| | | HttpServletRequest request, |
| | | HttpServletResponse response) { |
| | | return ownerAppLoginSMOImpl.refreshToken(null, redirectUrl, request, response); |
| | | return ownerAppLoginSMOImpl.refreshToken(null, redirectUrl,errorUrl, request, response); |
| | | |
| | | } |
| | | |
| | |
| | | ResponseEntity<String> doLogin(IPageData pd) throws SMOException; |
| | | |
| | | /** |
| | | * 根据key 登录 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象数据 |
| | | * @throws SMOException 业务代码层 |
| | | */ |
| | | ResponseEntity<String> doLoginByKey(IPageData pd) throws SMOException; |
| | | |
| | | /** |
| | | * 获取access_token |
| | | * |
| | | * @param pd |
| | |
| | | * @return |
| | | * @throws SMOException |
| | | */ |
| | | ResponseEntity<String> refreshToken(IPageData pd, String redirectUrl, HttpServletRequest request, HttpServletResponse response) throws SMOException; |
| | | ResponseEntity<String> refreshToken(IPageData pd, String redirectUrl, String errorUrl, |
| | | HttpServletRequest request, HttpServletResponse response) throws SMOException; |
| | | } |
| | |
| | | import com.java110.core.context.PageData; |
| | | import com.java110.core.factory.AuthenticationFactory; |
| | | import com.java110.dto.owner.OwnerAppUserDto; |
| | | import com.java110.dto.user.UserDto; |
| | | import com.java110.front.properties.WechatAuthProperties; |
| | | import com.java110.front.smo.ownerLogin.IOwnerAppLoginSMO; |
| | | import com.java110.utils.cache.CommonCache; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> doLoginByKey(IPageData pd) throws SMOException { |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | Assert.hasKeyAndValue(paramIn, "key", "请求报文中未包含临时秘钥"); |
| | | logger.debug("doLogin入参:" + paramIn.toJSONString()); |
| | | ResponseEntity<String> responseEntity; |
| | | |
| | | JSONObject loginInfo = JSONObject.parseObject(pd.getReqData()); |
| | | |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setKey(paramIn.getString("key")); |
| | | userDto = super.postForApi(pd, userDto, ServiceCodeConstant.SERVICE_CODE_USER_LOGIN, UserDto.class); |
| | | |
| | | |
| | | //根据用户查询商户信息 |
| | | String userId = userDto.getUserId(); |
| | | |
| | | pd = PageData.newInstance().builder(userId, "", "", pd.getReqData(), |
| | | "", "", "", "", |
| | | pd.getAppId()); |
| | | OwnerAppUserDto ownerAppUserDto = new OwnerAppUserDto(); |
| | | ownerAppUserDto.setUserId(userId); |
| | | List<OwnerAppUserDto> ownerAppUserDtos = super.getForApis(pd, ownerAppUserDto, ServiceCodeConstant.LIST_APPUSERBINDINGOWNERS, OwnerAppUserDto.class); |
| | | |
| | | |
| | | if (ownerAppUserDtos == null || ownerAppUserDtos.size() < 1) { |
| | | responseEntity = new ResponseEntity<>("用户未绑定业主", HttpStatus.BAD_REQUEST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | JSONObject appUser = JSONObject.parseObject(JSONObject.toJSONString(ownerAppUserDtos.get(0))); |
| | | appUser.put("userId", userId); |
| | | appUser.put("userName", paramIn.getString("username")); |
| | | JSONObject paramOut = new JSONObject(); |
| | | paramOut.put("code", 0); |
| | | paramOut.put("msg", "成功"); |
| | | paramOut.put("owner", appUser); |
| | | paramOut.put("token", userDto.getToken()); |
| | | paramOut.put("key", userDto.getKey()); |
| | | return new ResponseEntity<>(paramOut.toJSONString(), HttpStatus.OK); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> getPageAccessToken(IPageData pd) throws SMOException { |
| | | JSONObject paramIn = JSONObject.parseObject(pd.getReqData()); |
| | | String authCode = paramIn.getString("code"); |
| | | String state = paramIn.getString("state"); |
| | | String urlCode = CommonCache.getAndRemoveValue(paramIn.getString("urlCode")); |
| | | String paramStr = CommonCache.getAndRemoveValue(paramIn.getString("urlCode")); |
| | | |
| | | if (StringUtil.isEmpty(urlCode)) { |
| | | return ResultVo.redirectPage("/#/pages/login/login"); |
| | | if (StringUtil.isEmpty(paramStr)) { |
| | | return ResultVo.redirectPage("/"); |
| | | } |
| | | |
| | | JSONObject param = JSONObject.parseObject(paramStr); |
| | | String redirectUrl = param.getString("redirectUrl"); |
| | | String errorUrl = param.getString("errorUrl"); |
| | | |
| | | |
| | | String url = WechatConstant.APP_GET_ACCESS_TOKEN_URL.replace("APPID", wechatAuthProperties.getWechatAppId()) |
| | | .replace("SECRET", wechatAuthProperties.getWechatAppSecret()) |
| | |
| | | |
| | | ResponseEntity<String> paramOut = outRestTemplate.getForEntity(url, String.class); |
| | | |
| | | logger.debug("调用微信换去token ", paramOut); |
| | | logger.debug("调用微信换去openId ", paramOut); |
| | | if (paramOut.getStatusCode() != HttpStatus.OK) { |
| | | return ResultVo.redirectPage("/#/pages/login/login"); |
| | | return ResultVo.redirectPage(errorUrl); |
| | | |
| | | } |
| | | |
| | |
| | | //将openId放到redis 缓存,给前段下发临时票据 |
| | | String code = UUID.randomUUID().toString(); |
| | | CommonCache.setValue(code, openId, expireTime); |
| | | return ResultVo.redirectPage("/#/pages/login/login?code=" + code); |
| | | return ResultVo.redirectPage(errorUrl + "?code=" + code); |
| | | } |
| | | |
| | | // String accessToken = paramObj.getString("access_token");//暂时不用 |
| | |
| | | } catch (Exception e) { |
| | | logger.error("创建token失败"); |
| | | } |
| | | return ResultVo.redirectPage("/"); |
| | | //查询用户key |
| | | UserDto userDto = new UserDto(); |
| | | userDto.setUserId(ownerAppUserDtos.get(0).getUserId()); |
| | | UserDto tmpUserDto = super.getForApi(pd, userDto, ServiceCodeConstant.QUERY_USER_SECRET, UserDto.class); |
| | | redirectUrl = redirectUrl + (redirectUrl.indexOf("?") > 0 ? "&key=" + tmpUserDto.getKey() : "?key=" + tmpUserDto.getKey()); |
| | | return ResultVo.redirectPage(redirectUrl); |
| | | |
| | | } |
| | | |
| | |
| | | * @throws SMOException |
| | | */ |
| | | @Override |
| | | public ResponseEntity<String> refreshToken(IPageData pd, String redirectUrl, HttpServletRequest request, HttpServletResponse response) throws SMOException { |
| | | public ResponseEntity<String> refreshToken(IPageData pd, String redirectUrl, |
| | | String errorUrl, |
| | | HttpServletRequest request, HttpServletResponse response) throws SMOException { |
| | | //分配urlCode |
| | | String urlCode = UUID.randomUUID().toString(); |
| | | CommonCache.setValue(urlCode, redirectUrl, expireTime); |
| | | JSONObject param = new JSONObject(); |
| | | param.put("redirectUrl", redirectUrl); |
| | | param.put("errorUrl", errorUrl); |
| | | CommonCache.setValue(urlCode, param.toJSONString(), expireTime); |
| | | |
| | | URL url = null; |
| | | String openUrl = ""; |