管理端和商家端userInfo字段名变更,管理端会员详情,他的积分字段调整
parent
726ae1f856
commit
0387ac510a
|
@ -52,7 +52,7 @@ service.interceptors.response.use(
|
||||||
break;
|
break;
|
||||||
case 401:
|
case 401:
|
||||||
// 未登录 清除已登录状态
|
// 未登录 清除已登录状态
|
||||||
Cookies.set("userInfo", "");
|
Cookies.set("userInfoManager", "");
|
||||||
setStore("accessToken", "");
|
setStore("accessToken", "");
|
||||||
if (router.history.current.name != "login") {
|
if (router.history.current.name != "login") {
|
||||||
if (data.message !== null) {
|
if (data.message !== null) {
|
||||||
|
@ -95,7 +95,7 @@ service.interceptors.response.use(
|
||||||
router.go(0)
|
router.go(0)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Cookies.set("userInfo", "");
|
Cookies.set("userInfoManager", "");
|
||||||
router.push('/login')
|
router.push('/login')
|
||||||
}
|
}
|
||||||
isRefreshToken = 0
|
isRefreshToken = 0
|
||||||
|
|
|
@ -320,7 +320,7 @@ util.initRouter = function (vm) { // 初始化路由
|
||||||
frontRoute: 'error-page/404'
|
frontRoute: 'error-page/404'
|
||||||
}];
|
}];
|
||||||
// 判断用户是否登录
|
// 判断用户是否登录
|
||||||
let userInfo = Cookies.get('userInfo')
|
let userInfo = Cookies.get('userInfoManager')
|
||||||
if (!userInfo) {
|
if (!userInfo) {
|
||||||
// 未登录
|
// 未登录
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -23,12 +23,12 @@ router.beforeEach((to, from, next) => {
|
||||||
|
|
||||||
const name = to.name;
|
const name = to.name;
|
||||||
|
|
||||||
if (!Cookies.get('userInfo') && name !== 'login') {
|
if (!Cookies.get('userInfoManager') && name !== 'login') {
|
||||||
// 判断是否已经登录且前往的页面不是登录页
|
// 判断是否已经登录且前往的页面不是登录页
|
||||||
next({
|
next({
|
||||||
name: 'login'
|
name: 'login'
|
||||||
});
|
});
|
||||||
} else if (Cookies.get('userInfo') && name === 'login') {
|
} else if (Cookies.get('userInfoManager') && name === 'login') {
|
||||||
// 判断是否已经登录且前往的是登录页
|
// 判断是否已经登录且前往的是登录页
|
||||||
Util.title();
|
Util.title();
|
||||||
next({
|
next({
|
||||||
|
|
|
@ -4,7 +4,7 @@ const user = {
|
||||||
state: {},
|
state: {},
|
||||||
mutations: {
|
mutations: {
|
||||||
logout () {
|
logout () {
|
||||||
Cookies.remove('userInfo');
|
Cookies.remove('userInfoManager');
|
||||||
// 清空打开的页面等数据
|
// 清空打开的页面等数据
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
// 菜单初始化
|
// 菜单初始化
|
||||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
let userInfo = JSON.parse(Cookies.get("userInfoManager"));
|
||||||
|
|
||||||
this.userInfo = userInfo;
|
this.userInfo = userInfo;
|
||||||
this.checkTag(this.$route.name);
|
this.checkTag(this.$route.name);
|
||||||
|
|
|
@ -87,8 +87,7 @@ export default {
|
||||||
userInfo().then((res) => {
|
userInfo().then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// 加载菜单
|
// 加载菜单
|
||||||
this.setStore("userInfo", res.result);
|
Cookies.set("userInfoManager", JSON.stringify(res.result));
|
||||||
Cookies.set("userInfo", JSON.stringify(res.result));
|
|
||||||
this.$store.commit("setAvatarPath", res.result.avatar);
|
this.$store.commit("setAvatarPath", res.result.avatar);
|
||||||
util.initRouter(this);
|
util.initRouter(this);
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
|
|
|
@ -417,7 +417,7 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
title: "变动积分",
|
title: "变动积分",
|
||||||
key: "point",
|
key: "variablePoint",
|
||||||
width: 150,
|
width: 150,
|
||||||
render: (h, params) => {
|
render: (h, params) => {
|
||||||
if (params.row.pointType == 'INCREASE') {
|
if (params.row.pointType == 'INCREASE') {
|
||||||
|
@ -426,7 +426,7 @@
|
||||||
style: {
|
style: {
|
||||||
color: 'green'
|
color: 'green'
|
||||||
}
|
}
|
||||||
}, "+" + params.row.point),
|
}, "+" + params.row.variablePoint),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
return h('div', [
|
return h('div', [
|
||||||
|
@ -434,7 +434,7 @@
|
||||||
style: {
|
style: {
|
||||||
color: 'red'
|
color: 'red'
|
||||||
}
|
}
|
||||||
}, "-" + params.row.point),
|
}, "-" + params.row.variablePoint),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
let v = JSON.parse(Cookies.get("userInfo"));
|
let v = JSON.parse(Cookies.get("userInfoManager"));
|
||||||
// 转换null为""
|
// 转换null为""
|
||||||
for (let attr in v) {
|
for (let attr in v) {
|
||||||
if (v[attr] == null) {
|
if (v[attr] == null) {
|
||||||
|
@ -112,7 +112,7 @@ export default {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("保存成功");
|
this.$Message.success("保存成功");
|
||||||
// 更新用户信息
|
// 更新用户信息
|
||||||
Cookies.set("userInfo", this.userForm);
|
Cookies.set("userInfoManager", this.userForm);
|
||||||
// 更新头像
|
// 更新头像
|
||||||
this.$store.commit("setAvatarPath", this.userForm.avatar);
|
this.$store.commit("setAvatarPath", this.userForm.avatar);
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
|
|
|
@ -18,14 +18,14 @@ export default {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
api_dev: {
|
api_dev: {
|
||||||
// common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
// buyer: "https://buyer-api.pickmall.cn",
|
buyer: "https://buyer-api.pickmall.cn",
|
||||||
// seller: "https://store-api.pickmall.cn",
|
seller: "https://store-api.pickmall.cn",
|
||||||
// manager: "https://admin-api.pickmall.cn"
|
manager: "https://admin-api.pickmall.cn"
|
||||||
common: 'http://192.168.0.100:8890',
|
// common: 'http://192.168.0.100:8890',
|
||||||
buyer: 'http://192.168.0.100:8888',
|
// buyer: 'http://192.168.0.100:8888',
|
||||||
seller: 'http://192.168.0.100:8889',
|
// seller: 'http://192.168.0.100:8889',
|
||||||
manager: 'http://192.168.0.100:8887'
|
// manager: 'http://192.168.0.100:8887'
|
||||||
},
|
},
|
||||||
api_prod: {
|
api_prod: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
|
|
|
@ -58,7 +58,7 @@ service.interceptors.response.use(
|
||||||
break;
|
break;
|
||||||
case 401:
|
case 401:
|
||||||
// 未登录 清除已登录状态
|
// 未登录 清除已登录状态
|
||||||
Cookies.set("userInfo", "");
|
Cookies.set("userInfoSeller", "");
|
||||||
setStore("accessToken", "");
|
setStore("accessToken", "");
|
||||||
if (router.history.current.name != "login") {
|
if (router.history.current.name != "login") {
|
||||||
if (data.message !== null) {
|
if (data.message !== null) {
|
||||||
|
@ -103,7 +103,7 @@ service.interceptors.response.use(
|
||||||
router.go(0);
|
router.go(0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Cookies.set("userInfo", "");
|
Cookies.set("userInfoSeller", "");
|
||||||
router.push("/login");
|
router.push("/login");
|
||||||
}
|
}
|
||||||
isRefreshToken = 0;
|
isRefreshToken = 0;
|
||||||
|
|
|
@ -318,11 +318,11 @@ util.initRouter = function (vm) { // 初始化路由
|
||||||
component: 'error-page/404'
|
component: 'error-page/404'
|
||||||
}];
|
}];
|
||||||
// 判断用户是否登录
|
// 判断用户是否登录
|
||||||
let userInfo = Cookies.get('userInfo')
|
let userInfo = Cookies.get('userInfoSeller')
|
||||||
// if (!userInfo) {
|
if (!userInfo) {
|
||||||
// // 未登录
|
// 未登录
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
if (!vm.$store.state.app.added) {
|
if (!vm.$store.state.app.added) {
|
||||||
// 第一次加载 读取数据
|
// 第一次加载 读取数据
|
||||||
|
|
|
@ -23,12 +23,12 @@ router.beforeEach((to, from, next) => {
|
||||||
|
|
||||||
const name = to.name;
|
const name = to.name;
|
||||||
|
|
||||||
if (!Cookies.get('userInfo') && name !== 'login') {
|
if (!Cookies.get('userInfoSeller') && name !== 'login') {
|
||||||
// 判断是否已经登录且前往的页面不是登录页
|
// 判断是否已经登录且前往的页面不是登录页
|
||||||
next({
|
next({
|
||||||
name: 'login'
|
name: 'login'
|
||||||
});
|
});
|
||||||
} else if (Cookies.get('userInfo') && name === 'login') {
|
} else if (Cookies.get('userInfoSeller') && name === 'login') {
|
||||||
// 判断是否已经登录且前往的是登录页
|
// 判断是否已经登录且前往的是登录页
|
||||||
Util.title();
|
Util.title();
|
||||||
next({
|
next({
|
||||||
|
|
|
@ -4,7 +4,7 @@ const user = {
|
||||||
state: {},
|
state: {},
|
||||||
mutations: {
|
mutations: {
|
||||||
logout () {
|
logout () {
|
||||||
Cookies.remove('userInfo');
|
Cookies.remove('userInfoSeller');
|
||||||
// 清空打开的页面等数据
|
// 清空打开的页面等数据
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ export default {
|
||||||
this.$store.commit("addOpenSubmenu", pathArr[1].name);
|
this.$store.commit("addOpenSubmenu", pathArr[1].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
let userInfo = JSON.parse(Cookies.get("userInfoSeller"));
|
||||||
this.userInfo = userInfo;
|
this.userInfo = userInfo;
|
||||||
this.checkTag(this.$route.name);
|
this.checkTag(this.$route.name);
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
async init() {
|
async init() {
|
||||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
let userInfo = JSON.parse(Cookies.get("userInfoSeller"));
|
||||||
|
|
||||||
this.userData = userInfo;
|
this.userData = userInfo;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.storeId = JSON.parse(Cookies.get("userInfo")).id;
|
this.storeId = JSON.parse(Cookies.get("userInfoSeller")).id;
|
||||||
this.getFiveYears();
|
this.getFiveYears();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -103,13 +103,12 @@ export default {
|
||||||
this.setStore("saveLogin", this.saveLogin);
|
this.setStore("saveLogin", this.saveLogin);
|
||||||
if (this.saveLogin) {
|
if (this.saveLogin) {
|
||||||
// 保存7天
|
// 保存7天
|
||||||
Cookies.set("userInfo", JSON.stringify(res.result), {
|
Cookies.set("userInfoSeller", JSON.stringify(res.result), {
|
||||||
expires: 7,
|
expires: 7,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Cookies.set("userInfo", JSON.stringify(res.result));
|
Cookies.set("userInfoSeller", JSON.stringify(res.result));
|
||||||
}
|
}
|
||||||
this.setStore("userInfo", res.result);
|
|
||||||
this.$store.commit("setAvatarPath", res.result.storeLogo);
|
this.$store.commit("setAvatarPath", res.result.storeLogo);
|
||||||
// 加载菜单
|
// 加载菜单
|
||||||
util.initRouter(this);
|
util.initRouter(this);
|
||||||
|
|
|
@ -254,8 +254,7 @@ export default {
|
||||||
},
|
},
|
||||||
// 导出的待发货订单数据
|
// 导出的待发货订单数据
|
||||||
async exportOrder () {
|
async exportOrder () {
|
||||||
let userInfo = JSON.parse(Cookies.get("userInfo"));
|
let userInfo = JSON.parse(Cookies.get("userInfoSeller"));
|
||||||
console.log(userInfo);
|
|
||||||
const params = {
|
const params = {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
pageNumber: 1, // 当前页数
|
pageNumber: 1, // 当前页数
|
||||||
|
|
|
@ -201,7 +201,7 @@ export default {
|
||||||
this.$set(this.form, "address", res.result.storeAddressPath);
|
this.$set(this.form, "address", res.result.storeAddressPath);
|
||||||
this.storeName = res.result.storeName;
|
this.storeName = res.result.storeName;
|
||||||
this.form.center = res.result.storeCenter;
|
this.form.center = res.result.storeCenter;
|
||||||
Cookies.set("userInfo", JSON.stringify(res.result));
|
Cookies.set("userInfoSeller", JSON.stringify(res.result));
|
||||||
//库存预警数赋值
|
//库存预警数赋值
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default {
|
||||||
searchType: "LAST_SEVEN",
|
searchType: "LAST_SEVEN",
|
||||||
year: "",
|
year: "",
|
||||||
month: "",
|
month: "",
|
||||||
storeId: JSON.parse(Cookies.get("userInfo")).id || '',
|
storeId: JSON.parse(Cookies.get("userInfoSeller")).id || '',
|
||||||
type: "NUM"
|
type: "NUM"
|
||||||
},
|
},
|
||||||
columns: [ // 表格表头
|
columns: [ // 表格表头
|
||||||
|
|
|
@ -397,20 +397,20 @@ export default {
|
||||||
orderParams: {
|
orderParams: {
|
||||||
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
||||||
year: "",
|
year: "",
|
||||||
storeId: JSON.parse(Cookies.get("userInfo")).id || "",
|
storeId: JSON.parse(Cookies.get("userInfoSeller")).id || "",
|
||||||
memberId: "",
|
memberId: "",
|
||||||
},
|
},
|
||||||
// 订单概念
|
// 订单概念
|
||||||
overViewParams: {
|
overViewParams: {
|
||||||
month: "",
|
month: "",
|
||||||
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
||||||
storeId: JSON.parse(Cookies.get("userInfo")).id || "",
|
storeId: JSON.parse(Cookies.get("userInfoSeller")).id || "",
|
||||||
year: "",
|
year: "",
|
||||||
},
|
},
|
||||||
defaultParams: {
|
defaultParams: {
|
||||||
month: "",
|
month: "",
|
||||||
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
searchType: "LAST_SEVEN", // TODAY , YESTERDAY , LAST_SEVEN , LAST_THIRTY
|
||||||
storeId: JSON.parse(Cookies.get("userInfo")).id || "",
|
storeId: JSON.parse(Cookies.get("userInfoSeller")).id || "",
|
||||||
year: "",
|
year: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ export default {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
searchType: "LAST_SEVEN",
|
searchType: "LAST_SEVEN",
|
||||||
storeId: JSON.parse(Cookies.get("userInfo")).id || "",
|
storeId: JSON.parse(Cookies.get("userInfoSeller")).id || "",
|
||||||
year: "",
|
year: "",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ export default {
|
||||||
searchType: "LAST_SEVEN",
|
searchType: "LAST_SEVEN",
|
||||||
year: "",
|
year: "",
|
||||||
month: "",
|
month: "",
|
||||||
storeId: JSON.parse(Cookies.get("userInfo")).id || "",
|
storeId: JSON.parse(Cookies.get("userInfoSeller")).id || "",
|
||||||
},
|
},
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue