[web-app,monitor] 提供后台接口保护,打通前端认证登陆

This commit is contained in:
tomsun28
2021-12-03 09:15:53 +08:00
parent a8ed6ef3a9
commit e7e2e87e11
10 changed files with 211 additions and 27 deletions

View File

@@ -102,8 +102,8 @@ export const USERS = {
'POST /user/avatar': 'ok',
'POST /login/account': (req: MockRequest) => {
const data = req.body;
if (!(data.userName === 'admin' || data.userName === 'user') || data.password !== 'admin@123') {
return { msg: `Invalid username or passwordadmin/admin@123` };
if (!(data.userName === 'admin' || data.userName === 'user') || data.password !== 'admin') {
return { msg: `Invalid username or passwordadmin/admin` };
}
return {
msg: 'ok',