mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-17 16:35:53 +08:00
管理端和商家端userInfo字段名变更,管理端会员详情,他的积分字段调整
This commit is contained in:
@@ -52,7 +52,7 @@ service.interceptors.response.use(
|
||||
break;
|
||||
case 401:
|
||||
// 未登录 清除已登录状态
|
||||
Cookies.set("userInfo", "");
|
||||
Cookies.set("userInfoManager", "");
|
||||
setStore("accessToken", "");
|
||||
if (router.history.current.name != "login") {
|
||||
if (data.message !== null) {
|
||||
@@ -95,7 +95,7 @@ service.interceptors.response.use(
|
||||
router.go(0)
|
||||
}
|
||||
} else {
|
||||
Cookies.set("userInfo", "");
|
||||
Cookies.set("userInfoManager", "");
|
||||
router.push('/login')
|
||||
}
|
||||
isRefreshToken = 0
|
||||
|
||||
@@ -320,7 +320,7 @@ util.initRouter = function (vm) { // 初始化路由
|
||||
frontRoute: 'error-page/404'
|
||||
}];
|
||||
// 判断用户是否登录
|
||||
let userInfo = Cookies.get('userInfo')
|
||||
let userInfo = Cookies.get('userInfoManager')
|
||||
if (!userInfo) {
|
||||
// 未登录
|
||||
return;
|
||||
|
||||
@@ -23,12 +23,12 @@ router.beforeEach((to, from, next) => {
|
||||
|
||||
const name = to.name;
|
||||
|
||||
if (!Cookies.get('userInfo') && name !== 'login') {
|
||||
if (!Cookies.get('userInfoManager') && name !== 'login') {
|
||||
// 判断是否已经登录且前往的页面不是登录页
|
||||
next({
|
||||
name: 'login'
|
||||
});
|
||||
} else if (Cookies.get('userInfo') && name === 'login') {
|
||||
} else if (Cookies.get('userInfoManager') && name === 'login') {
|
||||
// 判断是否已经登录且前往的是登录页
|
||||
Util.title();
|
||||
next({
|
||||
|
||||
@@ -4,7 +4,7 @@ const user = {
|
||||
state: {},
|
||||
mutations: {
|
||||
logout () {
|
||||
Cookies.remove('userInfo');
|
||||
Cookies.remove('userInfoManager');
|
||||
// 清空打开的页面等数据
|
||||
localStorage.clear();
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
methods: {
|
||||
init() {
|
||||
// 菜单初始化
|
||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
||||
let userInfo = JSON.parse(Cookies.get("userInfoManager"));
|
||||
|
||||
this.userInfo = userInfo;
|
||||
this.checkTag(this.$route.name);
|
||||
|
||||
@@ -87,8 +87,7 @@ export default {
|
||||
userInfo().then((res) => {
|
||||
if (res.success) {
|
||||
// 加载菜单
|
||||
this.setStore("userInfo", res.result);
|
||||
Cookies.set("userInfo", JSON.stringify(res.result));
|
||||
Cookies.set("userInfoManager", JSON.stringify(res.result));
|
||||
this.$store.commit("setAvatarPath", res.result.avatar);
|
||||
util.initRouter(this);
|
||||
this.$router.push({
|
||||
|
||||
@@ -417,7 +417,7 @@
|
||||
|
||||
{
|
||||
title: "变动积分",
|
||||
key: "point",
|
||||
key: "variablePoint",
|
||||
width: 150,
|
||||
render: (h, params) => {
|
||||
if (params.row.pointType == 'INCREASE') {
|
||||
@@ -426,7 +426,7 @@
|
||||
style: {
|
||||
color: 'green'
|
||||
}
|
||||
}, "+" + params.row.point),
|
||||
}, "+" + params.row.variablePoint),
|
||||
]);
|
||||
} else {
|
||||
return h('div', [
|
||||
@@ -434,7 +434,7 @@
|
||||
style: {
|
||||
color: 'red'
|
||||
}
|
||||
}, "-" + params.row.point),
|
||||
}, "-" + params.row.variablePoint),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
let v = JSON.parse(Cookies.get("userInfo"));
|
||||
let v = JSON.parse(Cookies.get("userInfoManager"));
|
||||
// 转换null为""
|
||||
for (let attr in v) {
|
||||
if (v[attr] == null) {
|
||||
@@ -112,7 +112,7 @@ export default {
|
||||
if (res.success) {
|
||||
this.$Message.success("保存成功");
|
||||
// 更新用户信息
|
||||
Cookies.set("userInfo", this.userForm);
|
||||
Cookies.set("userInfoManager", this.userForm);
|
||||
// 更新头像
|
||||
this.$store.commit("setAvatarPath", this.userForm.avatar);
|
||||
setTimeout(()=>{
|
||||
|
||||
Reference in New Issue
Block a user