编写登录用的api和后端代码
This commit is contained in:
68
code/web/task_schedule/src/views/Login.vue
Normal file
68
code/web/task_schedule/src/views/Login.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<!--
|
||||
* @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:
|
||||
* 登录页面,路由默认指向这个页面
|
||||
* 1、判断url中的参数,取得用户信息,根据用户的部门改变路由
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<span>{{ ui.p13uid }}</span>
|
||||
<br>
|
||||
<span>存储的P13:{{ ui.savedP13uid }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { reactive } from "vue";
|
||||
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 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, };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
24
code/web/task_schedule/src/views/Public.vue
Normal file
24
code/web/task_schedule/src/views/Public.vue
Normal file
@@ -0,0 +1,24 @@
|
||||
<!--
|
||||
* @Author: Kane
|
||||
* @Date: 2023-02-28 19:10:54
|
||||
* @LastEditors: Kane
|
||||
* @FilePath: /task_schedule/src/views/Public.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
公共页面
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: "PublicPage",
|
||||
setup()
|
||||
{
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
Reference in New Issue
Block a user