...
|
...
|
@@ -30,6 +30,7 @@ const plugin = { |
|
|
// return Promise.reject();
|
|
|
},
|
|
|
initPurview(Vue, user) {
|
|
|
Vue.$cookie.set('_isLogin', true);
|
|
|
Vue.$cookie.set('shopsId', user.currentShop.id);
|
|
|
return userService.purviews().then((purviews) => {
|
|
|
this.updateUser(Vue, user, purviews);
|
...
|
...
|
@@ -78,9 +79,9 @@ const plugin = { |
|
|
local: (username, password) => {
|
|
|
return userService.login(username, password).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
Vue.$cookie.set('_isLogin', true);
|
|
|
this.initPurview(Vue, res.data);
|
|
|
return this.initPurview(Vue, res.data).then(() => {
|
|
|
return res.data;
|
|
|
});
|
|
|
}
|
|
|
return Promise.reject(res);
|
|
|
});
|
...
|
...
|
|