更新
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from "@/store";
|
||||
import { mapGetters } from "vuex";
|
||||
import Breadcrumb from "@/components/Breadcrumb";
|
||||
import Hamburger from "@/components/Hamburger";
|
||||
@@ -47,6 +48,7 @@ export default {
|
||||
serve.loginOut().then((res) => {
|
||||
if (res.code === 20000) {
|
||||
localStorage.removeItem("customerToken");
|
||||
store.dispatch("user/remove");
|
||||
this.$router.push("/login");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -30,6 +30,10 @@ const actions = {
|
||||
commit("SET_NAME", data.name);
|
||||
commit("SET_COMPANYTYPE", data);
|
||||
},
|
||||
remove({ commit }, data) {
|
||||
commit("SET_AUTH", null);
|
||||
commit("SET_COMPANYTYPE", "");
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Vue from "vue";
|
||||
import axios from "axios";
|
||||
import utils from "@/utils/encode";
|
||||
import store from "@/store";
|
||||
//加密白名单
|
||||
const encryptWhite = [];
|
||||
const env = process.env.VUE_APP_ENV;
|
||||
@@ -64,6 +65,7 @@ service.interceptors.response.use(
|
||||
if (res.code === 42011) {
|
||||
Vue.prototype.$message.error(res.msg || "您的登录已失效,请重新登录");
|
||||
localStorage.removeItem("removeItem");
|
||||
store.dispatch("user/remove");
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
|
||||
Reference in New Issue
Block a user