自己操作

master
lion 2 years ago
parent 59f4a66da5
commit 3f23db3de5

@ -53,8 +53,8 @@
destroy destroy
} from "@/api/system/baseForm.js" } from "@/api/system/baseForm.js"
import { import {
getWzglUser getInfo
} from "@/utils/auth.js" } from "@/api/user.js"
import { import {
getOutboundsStatus getOutboundsStatus
} from "@/api/contract.js" } from "@/api/contract.js"
@ -160,14 +160,25 @@
}, },
methods: { methods: {
async getUserName(){ async getUserName(){
const res = await JSON.parse(getWzglUser()) getInfo().then(res => {
this.userName = res.username console.log("res",res)
this.authName = res.name this.userName = res.username
for(var k of res.role){ this.authName = res.name
if(k.name=='系统管理员'){ for(var k of res.role){
this.roleName = k.name if(k.name=='系统管理员'){
} this.roleName = k.name
} }
}
}).catch(error => {})
// const res = await JSON.parse(getWzglUser())
// this.userName = res.username
// this.authName = res.name
// for(var k of res.role){
// if(k.name==''){
// this.roleName = k.name
// }
// }
}, },
async getindex() { async getindex() {
this.loading = true this.loading = true

@ -56,8 +56,8 @@
Message Message
} from 'element-ui' } from 'element-ui'
import { import {
getWzglUser getInfo
} from "@/utils/auth.js" } from "@/api/user.js"
import imports from "@/views/component/imports.vue" import imports from "@/views/component/imports.vue"
import { import {
index as fieldIndex index as fieldIndex
@ -152,14 +152,21 @@
}, },
methods: { methods: {
async getUserName(){ async getUserName(){
const res = JSON.parse(getWzglUser()) // const res = JSON.parse(getWzglUser())
console.log("res",res) // console.log("res",res)
for(var k of res.role){ // for(var k of res.role){
if(k.name=='系统管理员'){ // if(k.name==''){
this.roleName = k.name // this.roleName = k.name
// }
// }
getInfo().then(res => {
for(var k of res.role){
if(k.name=='系统管理员'){
this.roleName = k.name
}
} }
} this.authName = res.name
this.authName = res.name }).catch(error => {})
}, },
async getindex() { async getindex() {

Loading…
Cancel
Save