|
|
|
@@ -147,8 +147,6 @@ public class WeappController { |
|
|
|
if (!enterpriseStaffR.isFail() && enterpriseStaffR.getData() != null){ |
|
|
|
SysEnterpriseStaff enterpriseStaff = enterpriseStaffR.getData(); |
|
|
|
enterpriseStaff.setOpenid(obj.getOpenid()); |
|
|
|
log.error("根据手机号查询员工返回:1111{}", enterpriseStaff); |
|
|
|
log.error("根据手机号查询员工返回:2222{}", obj.getOpenid()); |
|
|
|
tenantService.saveEnterpriseStaff(enterpriseStaff, SecurityConstants.INNER); |
|
|
|
} |
|
|
|
String token = (String)map.get("access_token"); |
|
|
|
@@ -161,4 +159,32 @@ public class WeappController { |
|
|
|
return AjaxResult.success(map); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/signout") |
|
|
|
public AjaxResult signout(@RequestBody WeappSignUpReq signUpReq, HttpServletResponse response) { |
|
|
|
log.info("微信登出请求信息:{}", signUpReq); |
|
|
|
|
|
|
|
if (signUpReq == null || StringUtils.isEmpty(signUpReq.getWeappAuth())) { |
|
|
|
response.setStatus(500); |
|
|
|
return AjaxResult.error("请求参数错误"); |
|
|
|
} |
|
|
|
try { |
|
|
|
String str = CryptoUtil.decrypt(signUpReq.getWeappAuth()); |
|
|
|
WeappSessionResponse obj = JSON.parseObject(str, WeappSessionResponse.class); |
|
|
|
R<SysEnterpriseStaff> enterpriseStaffR = tenantService.queryStaff(obj.getOpenid(), SecurityConstants.INNER); |
|
|
|
log.info("根据手机号查询员工返回:{}", enterpriseStaffR); |
|
|
|
if (!enterpriseStaffR.isFail() && enterpriseStaffR.getData() != null){ |
|
|
|
SysEnterpriseStaff enterpriseStaff = enterpriseStaffR.getData(); |
|
|
|
enterpriseStaff.setOpenid(null); |
|
|
|
tenantService.saveEnterpriseStaff(enterpriseStaff, SecurityConstants.INNER); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
response.setStatus(500); |
|
|
|
return AjaxResult.error("服务器出错,登出失败"); |
|
|
|
} |
|
|
|
|
|
|
|
return AjaxResult.success(); |
|
|
|
} |
|
|
|
} |