|
|
@@ -8,6 +8,7 @@ function getLoginJson() {
|
|
|
"api": {
|
|
|
"method":"post",
|
|
|
"url":"http://localhost:8081/api/login",
|
|
|
+ "dataType":"form",
|
|
|
"headers": {
|
|
|
"Authorization": 'Bearer ' + getToken()
|
|
|
},
|
|
|
@@ -16,7 +17,7 @@ function getLoginJson() {
|
|
|
|
|
|
return data;
|
|
|
},
|
|
|
- "adaptor": function (data) {
|
|
|
+ "adaptor": function (data, response) {
|
|
|
// token 续期的问题,在app.html中进行续期判断.
|
|
|
if (data.status != "200") {
|
|
|
// 登录请求提交后,刷新验证码
|
|
|
@@ -25,8 +26,11 @@ function getLoginJson() {
|
|
|
// 存储登录token
|
|
|
let token = data.data.token;
|
|
|
|
|
|
- return data;
|
|
|
- },
|
|
|
+ return {
|
|
|
+ ...data,
|
|
|
+ status: 500
|
|
|
+ };
|
|
|
+ }
|
|
|
},
|
|
|
// "redirect": "http://www.baidu.com",
|
|
|
"wrapWithPanel": false,
|
|
|
@@ -48,7 +52,7 @@ function getLoginJson() {
|
|
|
"type": "input-text",
|
|
|
"label": false,
|
|
|
"placeholder": "用户名",
|
|
|
- "name": "name",
|
|
|
+ "name": "api_name",
|
|
|
"required": true
|
|
|
}
|
|
|
]
|
|
|
@@ -65,7 +69,7 @@ function getLoginJson() {
|
|
|
"type": "input-password",
|
|
|
"label": false,
|
|
|
"placeholder": "密码",
|
|
|
- "name": "pwd",
|
|
|
+ "name": "api_password",
|
|
|
"required": true
|
|
|
}
|
|
|
]
|
|
|
@@ -82,7 +86,7 @@ function getLoginJson() {
|
|
|
"type": "input-text",
|
|
|
"label": false,
|
|
|
"placeholder": "验证码",
|
|
|
- "name": "code",
|
|
|
+ "name": "api_captcha",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|