Skip to content

Commit b8ecda1

Browse files
committed
refine code
1 parent 62d2f62 commit b8ecda1

File tree

6 files changed

+11
-17
lines changed

6 files changed

+11
-17
lines changed

src/api/login.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
import fetch from 'utils/fetch';
1+
import fetch from 'utils/fetch'
22

33
export function loginByUsername(username, password) {
44
const data = {
55
username,
66
password
7-
};
7+
}
88
return fetch({
99
url: '/login/login',
1010
method: 'post',
1111
data
12-
});
12+
})
1313
}
1414

1515
export function logout() {
1616
return fetch({
1717
url: '/login/logout',
1818
method: 'post'
19-
});
19+
})
2020
}
2121

2222
export function getInfo(token) {
2323
return fetch({
2424
url: '/user/info',
2525
method: 'get',
2626
params: { token }
27-
});
27+
})
2828
}
2929

src/mock/login.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default {
3434
if (userMap[token]) {
3535
return userMap[token];
3636
} else {
37-
return Promise.reject('a');
37+
return Promise.reject('error');
3838
}
3939
},
4040
logout: () => 'success'

src/permission.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function hasPermission(roles, permissionRoles) {
1212
}
1313

1414
// register global progress.
15-
const whiteList = ['/login', '/authredirect', '/reset', '/sendpwd']// 不重定向白名单
15+
const whiteList = ['/login', '/authredirect']// 不重定向白名单
1616
router.beforeEach((to, from, next) => {
1717
NProgress.start() // 开启Progress
1818
if (getToken()) { // 判断是否有token

src/store/modules/user.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ const user = {
4040
},
4141
SET_ROLES: (state, roles) => {
4242
state.roles = roles;
43-
},
44-
LOGIN_SUCCESS: () => {
45-
console.log('login success')
46-
},
47-
LOGOUT_USER: state => {
48-
state.user = '';
4943
}
5044
},
5145

src/views/excel/selectExcel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
})
7979
} else {
8080
this.$message({
81-
message: '请选择一条或多条记录导出',
82-
type: 'warning'
81+
message: '请选择一条或多条记录导出',
82+
type: 'warning'
8383
});
8484
}
8585
},

src/views/login/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<div class='tips'>账号:admin 密码随便填</div>
2525
<div class='tips'>账号:editor 密码随便填</div>
2626

27-
<el-button class='thirdPart-button' type="primary" @click='showDialog=true'>打开第三方登录</el-button>
27+
<el-button class='thirdparty-button' type="primary" @click='showDialog=true'>打开第三方登录</el-button>
2828
</el-form>
2929

3030
<el-dialog title="第三方验证" :visible.sync="showDialog">
@@ -198,7 +198,7 @@
198198
color: $dark_gray;
199199
cursor: pointer;
200200
}
201-
.thirdPart-button{
201+
.thirdparty-button{
202202
position: absolute;
203203
right: 35px;
204204
bottom: 28px;

0 commit comments

Comments
 (0)