保存进度!

This commit is contained in:
Kane Wang 2022-12-23 16:34:36 +08:00
parent e16afd1696
commit 1eae5068fe
4 changed files with 55 additions and 15 deletions

View File

@ -0,0 +1 @@
VUE_APP_API_URL_LOGIN = "http://localhost:8080/admin-system/account/p13_account_check.do"

View File

@ -0,0 +1,14 @@
/*
* @Author: Kane
* @Date: 2022-12-23 11:10:23
* @LastEditors: Kane
* @LastEditTime: 2022-12-23 11:11:58
* @FilePath: \admin_system\src\utils\api\config.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
export const API_URL = {
URL_LOGIN: process.env.VUE_APP_API_URL_LOGIN,
};

View File

@ -2,22 +2,24 @@
* @Author: Kane
* @Date: 2022-12-22 09:10:20
* @LastEditors: Kane
* @LastEditTime: 2022-12-22 20:54:10
* @LastEditTime: 2022-12-23 15:28:14
* @FilePath: \admin_system\src\utils\api\info\account.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import instance from "@/utils/api/request";
const URL_LOGIN = "http://localhost:8000/admin-sys/";
import { API_URL } from "@/utils/api/config"; //所有API的地址
export function Login(userInfo)
{
//debugger;
console.log(API_URL.URL_LOGIN);
return instance.request(
{
method: "post",
url: URL_LOGIN,
url: API_URL.URL_LOGIN,
userInfo,
}
);

View File

@ -1,8 +1,9 @@
<!-- eslint-disable no-unused-vars -->
<!--
* @Author: Kane
* @Date: 2022-12-14 15:23:54
* @LastEditors: Kane
* @LastEditTime: 2022-12-21 11:14:57
* @LastEditTime: 2022-12-23 16:29:08
* @FilePath: \admin_system\src\views\account\Login.vue
* @Description:
*
@ -13,8 +14,7 @@
<div class="form-warp">
<ul class="menu-tab">
<li :class="{ 'current': current_menu === item.type }" @click="onToggleMenu(item.type)" v-for="item in tab_menu"
:key="item.type">{{ item.label
}}
:key="item.type">{{ item.label }}
</li>
</ul>
<el-form ref="form" :model="form">
@ -42,7 +42,9 @@
</el-row>
</el-form-item>
<el-form-item>
<el-button type="primary" class="el-button-block">立即创建</el-button>
<el-button type="primary" class="el-button-block" @click="login">{{ current_menu === "login" ? "登录" :
"注册"
}}</el-button>
</el-form-item>
</el-form>
</div>
@ -50,32 +52,53 @@
</template>
<script>
// import { ref } from "vue";
import { Login } from "@/utils/api/info/account";
import { ElMessage } from "element-plus";
export default {
name: "loginPage",
data() {
data()
{
return {
loginForm: {
username: "",
password: "",
confirm_password: "",
validateCode: "",
},
tab_menu: [
{ type: "login", label: "登录" },
{ type: "regiester", label: "注册" },
],
current_menu: "",
}
};
},
methods: {
onToggleMenu(type) {
onToggleMenu(type)
{
this.current_menu = type;
console.log(process.env.VUE_APP_API_URL_LOGIN);
},
getValidateCode() {
console.log(this.$axios);
getValidateCode()
{
ElMessage({
message: "测试文字",
center: true,
type: "error",
});
},
login()
{
const userInfo = {
p13account: "588",
password: "Kane@1983",
};
Login(userInfo);
}
},
created() {
created()
{
//
this.current_menu = this.tab_menu[0].type;
}