|
|
|
@@ -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); |
|
|
|
|