|
@@ -64,8 +64,8 @@ export default {
|
|
html: '<ul class="popoverCon"><li>没有消息</li></ul><a class="popoverBtn">点击进入信息中心<span class="el-icon-d-arrow-right info_icon"></span></a>',
|
|
html: '<ul class="popoverCon"><li>没有消息</li></ul><a class="popoverBtn">点击进入信息中心<span class="el-icon-d-arrow-right info_icon"></span></a>',
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
- // this.checkUrl();
|
|
|
|
this.setUser();
|
|
this.setUser();
|
|
|
|
+ this.check();
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|
|
@@ -73,20 +73,8 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
...mapMutations(['setUser']),
|
|
...mapMutations(['setUser']),
|
|
...mapActions(['userOperation']),
|
|
...mapActions(['userOperation']),
|
|
- checkUrl() {
|
|
|
|
- if (this.user.corpid) return;
|
|
|
|
- if (location.search.length > 0) {
|
|
|
|
- let params = location.search.replace('?', '').split('=');
|
|
|
|
- let key = params[0];
|
|
|
|
- if (key.includes(`token`)) {
|
|
|
|
- let token = params[1];
|
|
|
|
- sessionStorage.setItem('token', token);
|
|
|
|
- let info = jwt.decode(token);
|
|
|
|
- this.setUser(info);
|
|
|
|
- let turnTo = window.location.href.replace(window.location.search, '');
|
|
|
|
- window.location.href = turnTo;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ check() {
|
|
|
|
+ if (!this.user.corpid) this.$router.push({ path: '/login' });
|
|
},
|
|
},
|
|
toClose() {
|
|
toClose() {
|
|
this.$refs.form.resetFields();
|
|
this.$refs.form.resetFields();
|