user username to login

This commit is contained in:
Pan
2017-08-30 18:13:44 +08:00
parent b44c7384dc
commit 25a4be5a93
4 changed files with 92 additions and 78 deletions

View File

@@ -27,9 +27,9 @@ const user = {
actions: {
// 登录
Login({ commit }, userInfo) {
const email = userInfo.email.trim()
const username = userInfo.username.trim()
return new Promise((resolve, reject) => {
login(email, userInfo.password).then(response => {
login(username, userInfo.password).then(response => {
const data = response.data
setToken(data.token)
commit('SET_TOKEN', data.token)