refactor: 回忆改用独立存储与请求响应 DTO,服务按域拆包
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
package com.guo.learningprogresstracker.controller;
|
||||
|
||||
import com.guo.learningprogresstracker.dto.LoginResult;
|
||||
import com.guo.learningprogresstracker.entity.CommonResult;
|
||||
import com.guo.learningprogresstracker.dto.request.LoginBody;
|
||||
import com.guo.learningprogresstracker.entity.CommonResult;
|
||||
import com.guo.learningprogresstracker.exception.AppException;
|
||||
import com.guo.learningprogresstracker.service.AiUsageService;
|
||||
import com.guo.learningprogresstracker.service.LoginService;
|
||||
@@ -14,7 +14,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
||||
@CrossOrigin
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@@ -31,8 +30,8 @@ public class LoginController {
|
||||
String token = loginService.login(userId);
|
||||
// 用量面板的入口是否显示由服务端白名单决定,前端只读这个布尔值
|
||||
boolean aiAdmin = aiUsageService.isAdmin();
|
||||
//todo 参数传递未加密
|
||||
return CommonResult.success("登录成功!", new LoginResult(token, aiAdmin));
|
||||
// todo 参数传递未加密
|
||||
return CommonResult.success("登录成功!", new LoginResult(token, aiAdmin, userId));
|
||||
}
|
||||
|
||||
@Operation(summary = "退出登录API")
|
||||
|
||||
Reference in New Issue
Block a user