<!--
 * @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>