fix
This commit is contained in:
@@ -43,19 +43,14 @@ public class WxOauthController {
|
||||
|
||||
@Resource
|
||||
private WxCustomMpService wxCustomMpService;
|
||||
|
||||
@Resource
|
||||
private IPlayCustomUserInfoService customUserInfoService;
|
||||
|
||||
@Resource
|
||||
private IPlayClerkUserInfoService clerkUserInfoService;
|
||||
|
||||
@Resource
|
||||
private WxTokenService tokenService;
|
||||
|
||||
@Resource
|
||||
private WxOauthService wxOauthService;
|
||||
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
@@ -104,6 +99,32 @@ public class WxOauthController {
|
||||
jsonObject.put("tokenValue", TOKEN_PREFIX + tokenValue);
|
||||
jsonObject.put("tokenName", CLERK_USER_LOGIN_TOKEN);
|
||||
jsonObject.put("loginDate", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
||||
jsonObject.put("pcData", clerkUserInfoService.getPcData(entity));
|
||||
clerkUserInfoService.updateTokenById(entity.getId(), tokenValue);
|
||||
return R.ok(jsonObject);
|
||||
} catch (Exception e) {
|
||||
log.error("顾客登录失败,", e);
|
||||
return R.unauthorized();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/clerk/login/dev")
|
||||
public R clerkLoginDev(@Validated @RequestBody WxUserLoginVo vo) {
|
||||
try {
|
||||
String userId = "a4471ef596a1";
|
||||
PlayClerkUserInfoEntity entity = clerkUserInfoService.selectById(userId);
|
||||
if (entity == null) {
|
||||
throw new CustomException("用户不存在");
|
||||
}
|
||||
// 缓存租户信息
|
||||
String redisKey = "TENANT_INFO:" + entity.getId();
|
||||
redisCache.setCacheObject(redisKey, entity.getTenantId());
|
||||
String tokenValue = tokenService.createWxUserToken(entity.getId());
|
||||
JSONObject jsonObject = JSONObject.from(clerkUserInfoService.getVo(entity));
|
||||
jsonObject.put("tokenValue", TOKEN_PREFIX + tokenValue);
|
||||
jsonObject.put("tokenName", CLERK_USER_LOGIN_TOKEN);
|
||||
jsonObject.put("loginDate", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
|
||||
jsonObject.put("pcData", clerkUserInfoService.getPcData(entity));
|
||||
clerkUserInfoService.updateTokenById(entity.getId(), tokenValue);
|
||||
return R.ok(jsonObject);
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user