pull/1/head
xiaozhiyong 2 years ago
parent 270ff52073
commit b202072939
  1. 2
      src/layout/components/Navbar.vue
  2. 2
      src/permission.js
  3. 4
      src/utils/request.js
  4. 2
      src/views/financialCenter/enterpriseRecharge/components/add.vue
  5. 2
      src/views/login/index.vue

@ -46,7 +46,7 @@ export default {
logout() { logout() {
serve.loginOut().then((res) => { serve.loginOut().then((res) => {
if (res.code === 20000) { if (res.code === 20000) {
localStorage.removeItem("token"); localStorage.removeItem("customerToken");
this.$router.push("/login"); this.$router.push("/login");
} }
}); });

@ -15,7 +15,7 @@ const whiteList = ["/login"]; // no redirect whitelist
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
NProgress.start(); NProgress.start();
document.title = getPageTitle(to.meta.title); document.title = getPageTitle(to.meta.title);
const hasToken = localStorage.getItem("token"); const hasToken = localStorage.getItem("customerToken");
if (hasToken) { if (hasToken) {
if (to.path === "/login") { if (to.path === "/login") {
next({ path: "/" }); next({ path: "/" });

@ -12,7 +12,7 @@ const service = axios.create({
// 请求拦截 // 请求拦截
service.interceptors.request.use( service.interceptors.request.use(
(config) => { (config) => {
let token = localStorage.getItem("token"); let token = localStorage.getItem("customerToken");
if (token) { if (token) {
config.headers["Authorization"] = token; config.headers["Authorization"] = token;
@ -63,7 +63,7 @@ service.interceptors.response.use(
if (res && res.code) { if (res && res.code) {
if (res.code === 42011) { if (res.code === 42011) {
Vue.prototype.$message.error(res.msg || "您的登录已失效,请重新登录"); Vue.prototype.$message.error(res.msg || "您的登录已失效,请重新登录");
localStorage.removeItem("token"); localStorage.removeItem("removeItem");
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 1000); }, 1000);

@ -164,7 +164,7 @@ export default {
imgDialog: false, imgDialog: false,
headers: { headers: {
dataSources: "WEB", dataSources: "WEB",
Authorization: localStorage.getItem("token"), Authorization: localStorage.getItem("customerToken"),
JSESSIONID: JSESSIONID, JSESSIONID: JSESSIONID,
token: utils.bcrypt(JSESSIONID), token: utils.bcrypt(JSESSIONID),
}, },

@ -155,7 +155,7 @@ export default {
return; return;
} }
localStorage.setItem("token", res.data.accessToken); localStorage.setItem("customerToken", res.data.accessToken);
this.$router.replace("/"); this.$router.replace("/");
}) })
.catch(() => { .catch(() => {

Loading…
Cancel
Save