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

This commit is contained in:
CaptainB 2023-04-18 17:16:19 +08:00 committed by 刘瑞斌
parent 4fabc826c9
commit 9bc3ddd6a8
4 changed files with 7 additions and 9 deletions

View File

@ -73,8 +73,8 @@ export function checkLdapOpen() {
return get('/ldap/open') return get('/ldap/open')
} }
export function getUserInfo(userId) { export function getUserInfo() {
return get(`/user/info/${userId}`); return get(`/user/info`);
} }
export function getWsAndPj(userId) { export function getWsAndPj(userId) {

View File

@ -184,7 +184,7 @@ export default {
.then((r) => { .then((r) => {
this.platformAccountConfigs = r.data; this.platformAccountConfigs = r.data;
}); });
this.result = getUserInfo(encodeURIComponent(this.currentUser().id)) this.result = getUserInfo()
.then(response => { .then(response => {
let data = response.data; let data = response.data;
this.isLocalUser = response.data.source === 'LOCAL'; this.isLocalUser = response.data.source === 'LOCAL';

View File

@ -30,7 +30,6 @@
</template> </template>
<script> <script>
import {getCurrentUserId} from "../../utils/token";
import {getUserInfo, updateSeleniumServer} from "../../api/user"; import {getUserInfo, updateSeleniumServer} from "../../api/user";
export default { export default {
@ -57,8 +56,7 @@ export default {
this.$emit("confirm"); this.$emit("confirm");
}, },
async getUserSeleniumServer() { async getUserSeleniumServer() {
let userId = getCurrentUserId(); let res = await getUserInfo();
let res = await getUserInfo(userId);
if (res.data) { if (res.data) {
this.seleniumServer = res.data.seleniumServer || ""; this.seleniumServer = res.data.seleniumServer || "";
} }

View File

@ -73,9 +73,9 @@ public class BaseUserController {
return baseUserService.getProjectMemberList(request); return baseUserService.getProjectMemberList(request);
} }
@GetMapping("/info/{userId}") @GetMapping("/info")
public UserDTO getUserInfo(@PathVariable(value = "userId") String userId) { public UserDTO getUserInfo() {
return baseUserService.getUserDTO(userId); return baseUserService.getUserDTO(SessionUtils.getUserId());
} }
/** /**