feat: 更改 api 引入的方法更合理化

This commit is contained in:
FairyEver
2020-12-28 14:06:04 +08:00
parent 219906665a
commit e02f4909d0
13 changed files with 134 additions and 159 deletions

View File

@@ -1,7 +1,7 @@
import { Message, MessageBox } from 'element-ui'
import util from '@/libs/util.js'
import router from '@/router'
import api from '@/api'
import { SYS_USER_LOGIN } from '@/api/sys.user.js'
export default {
namespaced: true,
@@ -17,7 +17,7 @@ export default {
username = '',
password = ''
} = {}) {
const res = await api.SYS_USER_LOGIN({ username, password })
const res = await SYS_USER_LOGIN({ username, password })
// 设置 cookie 一定要存 uuid 和 token 两个 cookie
// 整个系统依赖这两个数据进行校验和存储
// uuid 是用户身份唯一标识 用户注册的时候确定 并且不可改变 不可重复