Merge branch 'master' into refacor/style

This commit is contained in:
Pan
2017-11-29 10:05:09 +08:00
5 changed files with 9 additions and 2 deletions

View File

@@ -63,6 +63,9 @@ const user = {
GetUserInfo({ commit, state }) {
return new Promise((resolve, reject) => {
getUserInfo(state.token).then(response => {
if (!response.data) { // 由于mockjs 不支持自定义状态码只能这样hack
reject('error')
}
const data = response.data
commit('SET_ROLES', data.role)
commit('SET_NAME', data.name)