|
@@ -1,5 +1,6 @@
|
|
|
import storage from 'store'
|
|
|
import { login, loginBySms, getInfo, logout } from '@/api/login'
|
|
|
+import { logins} from '@/api/statistics/statistics'
|
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|
|
|
|
|
const user = {
|
|
@@ -67,6 +68,19 @@ const user = {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 登录2
|
|
|
+ Logins ({ commit }, userInfo) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ logins(userInfo).then(res => {
|
|
|
+ storage.set(ACCESS_TOKEN, res.token, 7 * 24 * 60 * 60 * 1000)
|
|
|
+ commit('SET_TOKEN', res.token)
|
|
|
+ resolve()
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 根据验证码登录
|
|
|
LoginBySms ({ commit }, userInfo) {
|
|
|
return new Promise((resolve, reject) => {
|