前端修改部分响应
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
"jsencrypt": "3.3.2",
|
||||
"nprogress": "0.2.0",
|
||||
"pinia": "3.0.2",
|
||||
"sortablejs": "^1.15.6",
|
||||
"splitpanes": "4.0.4",
|
||||
"vue": "3.5.16",
|
||||
"vue-cropper": "1.1.1",
|
||||
|
||||
4654
ruoyi-ui3/pnpm-lock.yaml
generated
Normal file
4654
ruoyi-ui3/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -26,8 +26,8 @@ const useUserStore = defineStore(
|
||||
const uuid = userInfo.uuid
|
||||
return new Promise((resolve, reject) => {
|
||||
login(username, password, code, uuid).then(res => {
|
||||
setToken(res.token)
|
||||
this.token = res.token
|
||||
setToken(res.data.token)
|
||||
this.token = res.data.token
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
@@ -38,14 +38,14 @@ const useUserStore = defineStore(
|
||||
getInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
getInfo().then(res => {
|
||||
const user = res.user
|
||||
const user = res.data.user
|
||||
let avatar = user.avatar || ""
|
||||
if (!isHttp(avatar)) {
|
||||
avatar = (isEmpty(avatar)) ? defAva : import.meta.env.VITE_APP_BASE_API + avatar
|
||||
}
|
||||
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.roles
|
||||
this.permissions = res.permissions
|
||||
if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组
|
||||
this.roles = res.data.roles
|
||||
this.permissions = res.data.permissions
|
||||
} else {
|
||||
this.roles = ['ROLE_DEFAULT']
|
||||
}
|
||||
|
||||
@@ -140,10 +140,10 @@ function handleLogin() {
|
||||
|
||||
function getCode() {
|
||||
getCodeImg().then(res => {
|
||||
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled
|
||||
captchaEnabled.value = res.data.captchaEnabled === undefined ? true : res.data.captchaEnabled
|
||||
if (captchaEnabled.value) {
|
||||
codeUrl.value = "data:image/gif;base64," + res.img
|
||||
loginForm.value.uuid = res.uuid
|
||||
codeUrl.value = "data:image/gif;base64," + res.data.img
|
||||
loginForm.value.uuid = res.data.uuid
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user