Skip to content
Snippets Groups Projects
Commit b8ecda19 authored by Pan's avatar Pan Committed by 花裤衩
Browse files

refine code

parent 62d2f62b
No related branches found
No related tags found
No related merge requests found
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 }
});
})
}
......@@ -34,7 +34,7 @@ export default {
if (userMap[token]) {
return userMap[token];
} else {
return Promise.reject('a');
return Promise.reject('error');
}
},
logout: () => 'success'
......
......@@ -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
......
......@@ -40,12 +40,6 @@ const user = {
},
SET_ROLES: (state, roles) => {
state.roles = roles;
},
LOGIN_SUCCESS: () => {
console.log('login success')
},
LOGOUT_USER: state => {
state.user = '';
}
},
......
......@@ -78,8 +78,8 @@
})
} else {
this.$message({
message: '请选择一条或多条记录导出',
type: 'warning'
message: '请选择一条或多条记录导出',
type: 'warning'
});
}
},
......
......@@ -24,7 +24,7 @@
<div class='tips'>账号:admin 密码随便填</div>
<div class='tips'>账号:editor 密码随便填</div>
<el-button class='thirdPart-button' type="primary" @click='showDialog=true'>打开第三方登录</el-button>
<el-button class='thirdparty-button' type="primary" @click='showDialog=true'>打开第三方登录</el-button>
</el-form>
<el-dialog title="第三方验证" :visible.sync="showDialog">
......@@ -198,7 +198,7 @@
color: $dark_gray;
cursor: pointer;
}
.thirdPart-button{
.thirdparty-button{
position: absolute;
right: 35px;
bottom: 28px;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment