cookie还原

dev_2020-03-03
yujialong 3 years ago
parent c40ef928c4
commit 0274687c2f
  1. 2
      src/layouts/header/index.vue
  2. 6
      src/libs/util.cookies.js

@ -93,7 +93,7 @@ export default {
})
},
toLogin() {
if (util.cookies.get('serverLogin') === 'true') {
if (util.cookies.get('serverLogin') === 'true' && util.local.get('oc_server_token')) {
window.open(process.env.NODE_ENV === 'development' ?
'http://192.168.31.125:8081/#/index' :
`${location.origin}/admin/#/index`)

@ -14,7 +14,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) {
expires: Setting.cookiesExpires
};
Object.assign(currentCookieSetting, cookieSetting);
Cookies.set(name, value, currentCookieSetting);
Cookies.set(`admin-${name}`, value, currentCookieSetting);
};
/**
@ -22,7 +22,7 @@ cookies.set = function(name = "default", value = "", cookieSetting = {}) {
* @param {String} name cookie name
*/
cookies.get = function(name = "default") {
return Cookies.get(name);
return Cookies.get(`admin-${name}`);
};
/**
@ -37,7 +37,7 @@ cookies.getAll = function() {
* @param {String} name cookie name
*/
cookies.remove = function(name = "default") {
return Cookies.remove(`${name}`);
return Cookies.remove(`admin-${name}`);
};
export default cookies;

Loading…
Cancel
Save