fix: 修复查询当前用户传入userid的缺陷

This commit is contained in:
CaptainB 2023-04-18 17:19:02 +08:00
parent e571533c67
commit 23e323144d
4 changed files with 6 additions and 7 deletions

View File

@ -142,9 +142,9 @@ public class UserController {
return SessionUtils.getUser();
}
@GetMapping("/info/{userId}")
public UserDTO getUserInfo(@PathVariable(value = "userId") String userId) {
return userService.getUserInfo(userId);
@GetMapping("/info")
public UserDTO getUserInfo() {
return userService.getUserInfo(SessionUtils.getUserId());
}
/**

View File

@ -165,7 +165,7 @@
});
},
initTableData() {
this.result = this.$get("/user/info/" + encodeURIComponent(this.currentUser().id), response => {
this.result = this.$get("/user/info", response => {
let data = response.data;
this.isLocalUser = response.data.source === 'LOCAL';
let dataList = [];

View File

@ -273,7 +273,7 @@ export default {
});
},
initTableData() {
this.result = this.$get("/user/info/" + encodeURIComponent(this.currentUser().id), response => {
this.result = this.$get("/user/info", response => {
let data = response.data;
this.isLocalUser = response.data.source === 'LOCAL';
let dataList = [];

View File

@ -54,8 +54,7 @@ export default {
this.$emit("confirm");
},
async getUserSeleniumServer() {
let userId = getCurrentUserId();
let res = await this.$get(`/user/info/${userId}`);
let res = await this.$get(`/user/info`);
if (res.data) {
this.seleniumServer = res.data.data.seleniumServer || "";
}