This commit is contained in:
Kane Wang 2022-12-23 20:34:21 +08:00
parent 1eae5068fe
commit 7e3af7a1e8
2 changed files with 34 additions and 7 deletions

View File

@ -2,7 +2,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-22 09:10:20 * @Date: 2022-12-22 09:10:20
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2022-12-23 15:28:14 * @LastEditTime: 2022-12-23 17:26:37
* @FilePath: \admin_system\src\utils\api\info\account.js * @FilePath: \admin_system\src\utils\api\info\account.js
* @Description: * @Description:
* *
@ -20,7 +20,7 @@ export function Login(userInfo)
{ {
method: "post", method: "post",
url: API_URL.URL_LOGIN, url: API_URL.URL_LOGIN,
userInfo, data: userInfo,
} }
); );
} }

View File

@ -3,7 +3,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-14 15:23:54 * @Date: 2022-12-14 15:23:54
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2022-12-23 16:29:08 * @LastEditTime: 2022-12-23 18:18:09
* @FilePath: \admin_system\src\views\account\Login.vue * @FilePath: \admin_system\src\views\account\Login.vue
* @Description: * @Description:
* *
@ -17,7 +17,8 @@
:key="item.type">{{ item.label }} :key="item.type">{{ item.label }}
</li> </li>
</ul> </ul>
<el-form ref="form" :model="form"> <!-- <el-form ref="form" :model="form"> -->
<el-form ref="form">
<el-form-item> <el-form-item>
<label class="form-label">用户名</label> <label class="form-label">用户名</label>
<el-input type="text" v-model.lazy.trim="loginForm.username"></el-input> <el-input type="text" v-model.lazy.trim="loginForm.username"></el-input>
@ -82,7 +83,7 @@ export default {
getValidateCode() getValidateCode()
{ {
ElMessage({ ElMessage({
message: "测试文字", message: "测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字",
center: true, center: true,
type: "error", type: "error",
}); });
@ -91,10 +92,36 @@ export default {
{ {
const userInfo = { const userInfo = {
p13account: "588", p13account: "588",
password: "Kane@1983", password: "Kane@19831",
}; };
Login(userInfo); Login(userInfo)
.then((response) =>
{
const data = response.data;
//
if (data.success === true)
{
ElMessage({
message: data.message,
type: "success",
center: true,
});
}
else
{
ElMessage({
message: data.message,
type: "error",
center: true,
});
}
})
.catch((error) =>
{
console.log(error);
});
} }
}, },
created() created()