From 3f23db3de568f813c86ec15c3df2d4c0c333ae08 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 14 Jul 2023 17:13:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=B7=B1=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/outbounds/index.vue | 31 +++++++++++++++++++++---------- src/views/stocks/index.vue | 25 ++++++++++++++++--------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/src/views/outbounds/index.vue b/src/views/outbounds/index.vue index 1eca294..d83ddf4 100644 --- a/src/views/outbounds/index.vue +++ b/src/views/outbounds/index.vue @@ -53,8 +53,8 @@ destroy } from "@/api/system/baseForm.js" import { - getWzglUser - } from "@/utils/auth.js" + getInfo + } from "@/api/user.js" import { getOutboundsStatus } from "@/api/contract.js" @@ -160,14 +160,25 @@ }, methods: { async getUserName(){ - 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 - } - } + getInfo().then(res => { + console.log("res",res) + this.userName = res.username + this.authName = res.name + for(var k of res.role){ + 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() { this.loading = true diff --git a/src/views/stocks/index.vue b/src/views/stocks/index.vue index 72e2599..b6e1d01 100644 --- a/src/views/stocks/index.vue +++ b/src/views/stocks/index.vue @@ -56,8 +56,8 @@ Message } from 'element-ui' import { - getWzglUser - } from "@/utils/auth.js" + getInfo + } from "@/api/user.js" import imports from "@/views/component/imports.vue" import { index as fieldIndex @@ -152,14 +152,21 @@ }, methods: { async getUserName(){ - const res = JSON.parse(getWzglUser()) - console.log("res",res) - for(var k of res.role){ - if(k.name=='系统管理员'){ - this.roleName = k.name + // const res = JSON.parse(getWzglUser()) + // console.log("res",res) + // for(var k of res.role){ + // if(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() {