编写登录用的api和后端代码

This commit is contained in:
2023-02-28 19:58:03 +08:00
parent e49f4426f3
commit 1fa3b7cfdc
9 changed files with 78 additions and 20 deletions

View File

@@ -1,78 +0,0 @@
<!--
* @Author: Kane
* @Date: 2023-02-28 00:57:21
* @LastEditors: Kane
* @FilePath: /deskop_task_schedule/code/web/task_schedule/src/components/login/Login.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
<el-input v-model.lazy.trim="ui.p13uid"></el-input>
<el-button type="danger" @click="onSave">保存</el-button>
<span>{{ ui.p13uid }}</span>
<br>
<span>存储的P13:{{ ui.savedP13uid }}
</span>
</template>
<script lang="ts">
import { reactive } from "vue";
import { StuffInfo } from "@/data/cpicxim/StuffInfo";
import { service as instance } from "@/utils/api/request";
const URL = "http://222.76.244.118:11001/admin-system/account/p13_account_check";
export default {
name: "LoginPage",
setup()
{
const ui = reactive({
p13uid: "",
savedP13uid: "",
});
const onSave = () =>
{
debugger;
const stuff = new StuffInfo();
//@ts-ignore
stuff.P13UID = ui.p13uid;
// saveStuffInfo(stuff);
};
const userInfo = {
p13account: "wangwei-202",
password: "Kane@1983",
};
instance.request(
{
method: "post",
url: URL,
data: userInfo,
}
)
.then((response) =>
{
// debugger;
const data = response.data;
if (data.success === true)
{
ui.savedP13uid = data.staff_info;
}
})
.catch((error) =>
{
ui.savedP13uid = error;
});
return { ui, onSave, };
},
};
</script>
<style scoped lang="scss"></style>