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