|
@@ -5,7 +5,7 @@ import { Notification } from 'element-ui';
|
|
const jwt = require('jsonwebtoken');
|
|
const jwt = require('jsonwebtoken');
|
|
Vue.use(Vuex);
|
|
Vue.use(Vuex);
|
|
const api = {
|
|
const api = {
|
|
- interface: `/api/user/login`,
|
|
|
|
|
|
+ interface: `/api/market/user/login`,
|
|
updatePassword: '/api/user/pwd_edit',
|
|
updatePassword: '/api/user/pwd_edit',
|
|
};
|
|
};
|
|
const state = () => ({});
|
|
const state = () => ({});
|
|
@@ -27,7 +27,7 @@ const actions = {
|
|
if (isWx) res = await this.$axios.$post(`${api.wxLogin}`, user);
|
|
if (isWx) res = await this.$axios.$post(`${api.wxLogin}`, user);
|
|
else res = await this.$axios.$post(`${api.interface}`, user);
|
|
else res = await this.$axios.$post(`${api.interface}`, user);
|
|
const setUser = (token, commit) => {
|
|
const setUser = (token, commit) => {
|
|
- localStorage.setItem('token', JSON.stringify(user));
|
|
|
|
|
|
+ localStorage.setItem('token', token);
|
|
commit('setUser', token, { root: true });
|
|
commit('setUser', token, { root: true });
|
|
};
|
|
};
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
@@ -38,6 +38,7 @@ const actions = {
|
|
// type: 'success',
|
|
// type: 'success',
|
|
// duration: 2000,
|
|
// duration: 2000,
|
|
// });
|
|
// });
|
|
|
|
+ return res;
|
|
} else {
|
|
} else {
|
|
if (needReturn) return res;
|
|
if (needReturn) return res;
|
|
else {
|
|
else {
|