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')
}
export function getUserInfo(userId) {
return get(`/user/info/${userId}`);
export function getUserInfo() {
return get(`/user/info`);
}
export function getWsAndPj(userId) {

View File

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

View File

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

View File

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