diff --git a/src/api/login.js b/src/api/login.js index cfcff27d..4674d1c8 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,22 +1,22 @@ -import fetch from 'utils/fetch'; +import fetch from 'utils/fetch' export function loginByUsername(username, password) { const data = { username, password - }; + } return fetch({ url: '/login/login', method: 'post', data - }); + }) } export function logout() { return fetch({ url: '/login/logout', method: 'post' - }); + }) } export function getInfo(token) { @@ -24,6 +24,6 @@ export function getInfo(token) { url: '/user/info', method: 'get', params: { token } - }); + }) } diff --git a/src/mock/login.js b/src/mock/login.js index 9baab9a1..010ad036 100644 --- a/src/mock/login.js +++ b/src/mock/login.js @@ -34,7 +34,7 @@ export default { if (userMap[token]) { return userMap[token]; } else { - return Promise.reject('a'); + return Promise.reject('error'); } }, logout: () => 'success' diff --git a/src/permission.js b/src/permission.js index 43c1cc59..61dc5e1c 100644 --- a/src/permission.js +++ b/src/permission.js @@ -12,7 +12,7 @@ function hasPermission(roles, permissionRoles) { } // register global progress. -const whiteList = ['/login', '/authredirect', '/reset', '/sendpwd']// 不重定向白名单 +const whiteList = ['/login', '/authredirect']// 不重定向白名单 router.beforeEach((to, from, next) => { NProgress.start() // 开启Progress if (getToken()) { // 判断是否有token diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 7582434b..7a0eec44 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -40,12 +40,6 @@ const user = { }, SET_ROLES: (state, roles) => { state.roles = roles; - }, - LOGIN_SUCCESS: () => { - console.log('login success') - }, - LOGOUT_USER: state => { - state.user = ''; } }, diff --git a/src/views/excel/selectExcel.vue b/src/views/excel/selectExcel.vue index 08a49d44..83064592 100644 --- a/src/views/excel/selectExcel.vue +++ b/src/views/excel/selectExcel.vue @@ -78,8 +78,8 @@ }) } else { this.$message({ - message: '请选择一条或多条记录导出', - type: 'warning' + message: '请选择一条或多条记录导出', + type: 'warning' }); } }, diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 5557a5f7..1021ba04 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -24,7 +24,7 @@