Compare commits

...

3 Commits

Author SHA1 Message Date
Kane Wang c96aad3b0d 进度 2022-12-23 20:34:36 +08:00
Kane Wang 7e3af7a1e8 进度 2022-12-23 20:34:21 +08:00
Kane Wang 1eae5068fe 保存进度! 2022-12-23 16:34:36 +08:00
6 changed files with 90 additions and 20 deletions

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2022-12-15 11:11:21
* @LastEditors: Kane
* @LastEditTime: 2022-12-16 22:02:03
* @LastEditTime: 2022-12-23 19:47:33
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\web\controllers\account\P13AccountCheckController.java
* @Description: P13账号验证用Controller
*
@ -98,7 +98,7 @@ public class P13AccountCheckController
} else
{
result.setSuccess( false );
result.setMessage( "验证失败,密码错误!" );
result.setMessage( "密码错误!" );
}
return result;

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2022-12-15 11:17:26
* @LastEditors: Kane
* @LastEditTime: 2022-12-16 21:53:30
* @LastEditTime: 2022-12-23 17:42:47
* @FilePath: \AdminSys\src\main\java\com\cpic\xim\web\controllers\account\P13AccountCheckResult.java
* @Description:
*
@ -80,12 +80,15 @@ public class P13AccountCheckResult
return true;
}
// 验证结果状态true为成功false为失败
@JsonProperty( "success")
private boolean success;
// 验证结果消息字符串用来提示前端
@JsonProperty( "message")
private String message;
// 验证成功后查询到的人员信息
@JsonProperty( "staff_info")
CpicXIMStaffInfo staffInfo;
}

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,23 +2,25 @@
* @Author: Kane
* @Date: 2022-12-22 09:10:20
* @LastEditors: Kane
* @LastEditTime: 2022-12-22 20:54:10
* @LastEditTime: 2022-12-23 17:26:37
* @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,
userInfo,
url: API_URL.URL_LOGIN,
data: 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 18:18:09
* @FilePath: \admin_system\src\views\account\Login.vue
* @Description:
*
@ -13,11 +14,11 @@
<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">
<!-- <el-form ref="form" :model="form"> -->
<el-form ref="form">
<el-form-item>
<label class="form-label">用户名</label>
<el-input type="text" v-model.lazy.trim="loginForm.username"></el-input>
@ -42,7 +43,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 +53,79 @@
</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@19831",
};
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()
{
//
this.current_menu = this.tab_menu[0].type;
}