保存进度!
This commit is contained in:
parent
e16afd1696
commit
1eae5068fe
|
@ -0,0 +1 @@
|
||||||
|
VUE_APP_API_URL_LOGIN = "http://localhost:8080/admin-system/account/p13_account_check.do"
|
|
@ -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,
|
||||||
|
};
|
|
@ -2,22 +2,24 @@
|
||||||
* @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-22 20:54:10
|
* @LastEditTime: 2022-12-23 15:28:14
|
||||||
* @FilePath: \admin_system\src\utils\api\info\account.js
|
* @FilePath: \admin_system\src\utils\api\info\account.js
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
import instance from "@/utils/api/request";
|
import instance from "@/utils/api/request";
|
||||||
|
import { API_URL } from "@/utils/api/config"; //所有API的地址
|
||||||
const URL_LOGIN = "http://localhost:8000/admin-sys/";
|
|
||||||
|
|
||||||
export function Login(userInfo)
|
export function Login(userInfo)
|
||||||
{
|
{
|
||||||
|
//debugger;
|
||||||
|
console.log(API_URL.URL_LOGIN);
|
||||||
|
|
||||||
return instance.request(
|
return instance.request(
|
||||||
{
|
{
|
||||||
method: "post",
|
method: "post",
|
||||||
url: URL_LOGIN,
|
url: API_URL.URL_LOGIN,
|
||||||
userInfo,
|
userInfo,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
<!-- eslint-disable no-unused-vars -->
|
||||||
<!--
|
<!--
|
||||||
* @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-21 11:14:57
|
* @LastEditTime: 2022-12-23 16:29:08
|
||||||
* @FilePath: \admin_system\src\views\account\Login.vue
|
* @FilePath: \admin_system\src\views\account\Login.vue
|
||||||
* @Description:
|
* @Description:
|
||||||
*
|
*
|
||||||
|
@ -13,8 +14,7 @@
|
||||||
<div class="form-warp">
|
<div class="form-warp">
|
||||||
<ul class="menu-tab">
|
<ul class="menu-tab">
|
||||||
<li :class="{ 'current': current_menu === item.type }" @click="onToggleMenu(item.type)" v-for="item in tab_menu"
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<el-form ref="form" :model="form">
|
<el-form ref="form" :model="form">
|
||||||
|
@ -42,7 +42,9 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -50,32 +52,53 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { ref } from "vue";
|
import { Login } from "@/utils/api/info/account";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "loginPage",
|
name: "loginPage",
|
||||||
data() {
|
data()
|
||||||
|
{
|
||||||
return {
|
return {
|
||||||
loginForm: {
|
loginForm: {
|
||||||
username: "",
|
username: "",
|
||||||
password: "",
|
password: "",
|
||||||
confirm_password: "",
|
confirm_password: "",
|
||||||
|
validateCode: "",
|
||||||
},
|
},
|
||||||
tab_menu: [
|
tab_menu: [
|
||||||
{ type: "login", label: "登录" },
|
{ type: "login", label: "登录" },
|
||||||
{ type: "regiester", label: "注册" },
|
{ type: "regiester", label: "注册" },
|
||||||
],
|
],
|
||||||
current_menu: "",
|
current_menu: "",
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onToggleMenu(type) {
|
onToggleMenu(type)
|
||||||
|
{
|
||||||
this.current_menu = type;
|
this.current_menu = type;
|
||||||
|
console.log(process.env.VUE_APP_API_URL_LOGIN);
|
||||||
},
|
},
|
||||||
getValidateCode() {
|
getValidateCode()
|
||||||
console.log(this.$axios);
|
{
|
||||||
|
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;
|
this.current_menu = this.tab_menu[0].type;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue