Commit e971214d by liangjianmin

js

parent bf8d8f51
Showing with 15 additions and 4 deletions
...@@ -23,9 +23,8 @@ ...@@ -23,9 +23,8 @@
<a href="#" class="fl"><span class="icon iconfont fl"></span></a> <a href="#" class="fl"><span class="icon iconfont fl"></span></a>
<div class="line"></div> <div class="line"></div>
<div class="login-v fl"> <div class="login-v fl">
<img class="fl" src="http://img.ichunt.com/test/images/ichunt/9f/34/9f349b1400f659e5ad270412d4dbe160.jpg" <img class="fl" :src="userinfo.avatar" alt="">
alt=""> <div class="fl namex">{{userinfo.contacts_name}}</div>
<div class="fl namex">460053411@qq.com</div>
<div class="fl lo-box-drop"> <div class="fl lo-box-drop">
<span class="icon iconfont"></span> <span class="icon iconfont"></span>
<div class="drop-box"> <div class="drop-box">
...@@ -161,10 +160,11 @@ ...@@ -161,10 +160,11 @@
name: 'menus', name: 'menus',
props: {}, props: {},
created() { created() {
this.getData();
}, },
data() { data() {
return { return {
userinfo: {},
collapse: false, collapse: false,
isIndexTab: true, isIndexTab: true,
tabSure: "", tabSure: "",
...@@ -200,6 +200,13 @@ ...@@ -200,6 +200,13 @@
this.tabss(this.$route.path) this.tabss(this.$route.path)
}, },
methods: { methods: {
getData() {
this.$http('get', "/api/user/getuserinfo").then(res => {
this.userinfo = res.data;
}).catch(err => {
})
},
changePwd() { changePwd() {
this.dialogVisible = true; this.dialogVisible = true;
}, },
......
...@@ -60,6 +60,10 @@ router.afterEach((to, from, next) => { ...@@ -60,6 +60,10 @@ router.afterEach((to, from, next) => {
}); });
axios.interceptors.response.use(res => { axios.interceptors.response.use(res => {
if (res.data.err_code === 101) {
window.location.href = '/#/login?referer=' + encodeURI(to.path);
history.go(0);
}
return res.data; return res.data;
}, error => { }, error => {
// Message('网络出现问题,请检查网络'); // Message('网络出现问题,请检查网络');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment