tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷
This commit is contained in:
@@ -14,38 +14,24 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
state: ''
|
||||
};
|
||||
return {};
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo('/pages_tool/login/login');
|
||||
} else {
|
||||
this.getStatus();
|
||||
this.init();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStatus() {
|
||||
this.$api.sendRequest({
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.state = res.data.state;
|
||||
if (res.data.state == 1) {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$store.dispatch('emptyCart');
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
init() {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$store.dispatch('emptyCart');
|
||||
//uni.removeStorageSync('authInfo');
|
||||
this.$util.redirectTo('/pages/index/index');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user