1.微信用户登录添加 token

This commit is contained in:
2025-08-05 15:52:14 +08:00
parent 3106d787da
commit 17e07e3985
2 changed files with 7 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package vvpkassistant.User.controller;
import cn.dev33.satoken.stp.StpUtil;
import cn.hutool.core.bean.BeanUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import vvpkassistant.CoinRecords.CoinRecords;
@@ -171,9 +172,13 @@ public class UserController {
userDao.updateById(oldUser);
}
result.put("info",tempModel);
UserModelVO userModelVO = BeanUtil.copyProperties(tempModel, UserModelVO.class);
StpUtil.login(userModelVO.getId());
userModelVO.setToken(StpUtil.getTokenValue());
result.put("info",userModelVO);
result.put("newAccount",true);
result.put("chatInfo",wxChatParam);
return ResponseData.success(result);
}

View File

@@ -23,4 +23,5 @@ public class UserModelVO {
private String token;
private Boolean newAccount;
private WxChatParam chatInfo;
private Integer mailVerification;
}