Browse Source

微信小程序signup接口修改10 添加log,修改逻辑

tags/B.2.6.4_20240106_base
yk 1 year ago
parent
commit
8c9fc3368d
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/wechat/controller/WeappController.java

+ 11
- 0
xueyi-modules/xueyi-system/src/main/java/com/xueyi/system/wechat/controller/WeappController.java View File

@@ -142,9 +142,20 @@ public class WeappController {
return AjaxResult.error("手机号无对应员工,请查证后重试!");
} else {
Map<String, Object> map = tokenService.createToken(loginInfoResult.getData());
R<SysEnterpriseStaff> enterpriseStaffR = tenantService.queryStaff(phone, SecurityConstants.INNER);
log.info("根据手机号查询员工返回:{}", enterpriseStaffR);
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");
log.info("信息,token:{}, enterpriseName:{}, source:{}", token, JwtUtil.getEnterpriseName(token),JwtUtil.getSourceName(token));
JSONObject json = staffService.fetchStaffByPhone(phone, Long.valueOf(JwtUtil.getEnterpriseId(token)), JwtUtil.getSourceName(token), SecurityConstants.INNER);


map.put("enterpriseName", loginInfoResult.getData().getEnterpriseName());
map.put("staff", json.get("data"));
return AjaxResult.success(map);


Loading…
Cancel
Save