Compare commits

..

No commits in common. "2a4dac58aceffbcbd138dee610eb6d1ba90000d3" and "f632bab6b3945422412aafc67f368070365132b7" have entirely different histories.

4 changed files with 5 additions and 11 deletions

View File

@ -50,9 +50,3 @@ export function updateUserInfo(data) {
data: data
})
}
export function getUserInfo(userId) {
return request({
url: '/system/user/' + userId,
method: 'get'
})
}

View File

@ -37,7 +37,7 @@ const useUserStore = defineStore('user', {
return new Promise((resolve, reject) => {
getInfo()
.then((res) => {
// res.user.avatar = import.meta.env.VITE_APP_BASE_API + res.user.avatar
res.user.avatar = import.meta.env.VITE_APP_BASE_API + res.user.avatar
const user = res.user
this.user = user
const avatar = user.avatar == '' || user.avatar == null ? defAva : user.avatar

View File

@ -97,10 +97,10 @@ const state = reactive({
postGroup: {}
})
async function getUser() {
function getUser() {
getUserProfile().then((response) => {
// response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
Object.assign(state.user,response.data)
response.data.avatar = import.meta.env.VITE_APP_BASE_API + response.data.avatar
state.user = response.data
state.roleGroup = response.roleGroup
state.postGroup = response.postGroup
})

View File

@ -68,7 +68,7 @@ function uploadImg(data) {
/** 关闭窗口 */
function closeDialog() {
options.img = userStore.user.avatar
// options.img = userStore.avatar
options.visible = false
}
const cancle = () => {