添加代码
This commit is contained in:
@@ -70,7 +70,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getStorageFun,USER_DATA,clear } from '@/utils/auth.js'
|
||||
import { getStorageFun,USER_DATA,clear } from '@/utils/auth.js';
|
||||
import { getUserInfo } from '@/api/auth.js';
|
||||
import Header from '@/components/header.vue';
|
||||
|
||||
export default {
|
||||
@@ -81,9 +82,18 @@
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.userData = getStorageFun(USER_DATA);
|
||||
// this.userData = getStorageFun(USER_DATA);
|
||||
this.getUserInfo();
|
||||
},
|
||||
methods:{
|
||||
// 查询用户等级
|
||||
async getUserInfo(){
|
||||
const result = await getUserInfo();
|
||||
if(result && result.bizcode === 100){
|
||||
const data = result.data;
|
||||
this.userData = result.data || {};
|
||||
}
|
||||
},
|
||||
// 退出登录
|
||||
loginOutFun(){
|
||||
clear();
|
||||
|
||||
Reference in New Issue
Block a user