测试
This commit is contained in:
		@@ -2,8 +2,8 @@
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-02-15 09:25:52
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @LastEditTime: 2023-02-28 01:15:01
 | 
			
		||||
 * @FilePath: /task_schedule/src/App.vue
 | 
			
		||||
 * @LastEditTime: 2023-02-28 18:45:57
 | 
			
		||||
 * @FilePath: /deskop_task_schedule/code/web/task_schedule/src/App.vue
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 | 
			
		||||
@@ -15,38 +15,16 @@
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import HelloWorld from "./components/HelloWorld.vue";
 | 
			
		||||
import zhCn from "element-plus/lib/locale/lang/zh-cn"; //element-plus语言组件
 | 
			
		||||
import { reactive } from "vue";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: "App",
 | 
			
		||||
  components: { HelloWorld },
 | 
			
		||||
  setup(props)
 | 
			
		||||
  components: {},
 | 
			
		||||
  setup()
 | 
			
		||||
  {
 | 
			
		||||
    const locale = zhCn;
 | 
			
		||||
    const ui = reactive({
 | 
			
		||||
      counter: 0,
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    const onCount = () =>
 | 
			
		||||
    {
 | 
			
		||||
      ui.counter++;
 | 
			
		||||
      console.log(ui.counter);
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    // setInterval(() =>
 | 
			
		||||
    // {
 | 
			
		||||
    //   ui.counter += 1;
 | 
			
		||||
    //   // console.log(counter);
 | 
			
		||||
    // }, 1000);
 | 
			
		||||
 | 
			
		||||
    // setInterval(() =>
 | 
			
		||||
    // {
 | 
			
		||||
    //   location.reload();
 | 
			
		||||
    // }, 5000);
 | 
			
		||||
 | 
			
		||||
    return { locale, ui, onCount };
 | 
			
		||||
    return { locale, };
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
@@ -8,13 +8,20 @@
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 | 
			
		||||
-->
 | 
			
		||||
<template>
 | 
			
		||||
    <el-input v-model="ui.p13uid"></el-input>
 | 
			
		||||
    <el-button type="danger">保存</el-button>
 | 
			
		||||
    <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",
 | 
			
		||||
@@ -22,11 +29,48 @@ export default {
 | 
			
		||||
    {
 | 
			
		||||
        const ui = reactive({
 | 
			
		||||
            p13uid: "",
 | 
			
		||||
            savedP13uid: "",
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        const onSave = () => 
 | 
			
		||||
        {
 | 
			
		||||
            debugger;
 | 
			
		||||
            const stuff = new StuffInfo();
 | 
			
		||||
 | 
			
		||||
            //@ts-ignore
 | 
			
		||||
            stuff.P13UID = ui.p13uid;
 | 
			
		||||
 | 
			
		||||
        return { ui, };
 | 
			
		||||
            // 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>
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										66
									
								
								code/web/task_schedule/src/data/cpicxim/StuffInfo.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								code/web/task_schedule/src/data/cpicxim/StuffInfo.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,66 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-02-28 14:48:30
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /deskop_task_schedule/code/web/task_schedule/src/data/cpicxim/StuffInfo.ts
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
class StuffInfo
 | 
			
		||||
{
 | 
			
		||||
    StuffInfo(
 | 
			
		||||
        stuff_code: string = "",
 | 
			
		||||
        stuff_name: string = "",
 | 
			
		||||
        p13uid: string = "",
 | 
			
		||||
        department_code: string = "",
 | 
			
		||||
        department_name: string = ""
 | 
			
		||||
    )
 | 
			
		||||
    {
 | 
			
		||||
        this._stuffCode = stuff_code;
 | 
			
		||||
        this._stuffName = stuff_name;
 | 
			
		||||
        this._p13uid = p13uid;
 | 
			
		||||
        this._department_code = department_code;
 | 
			
		||||
        this._department_name = department_name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public get StuffCode(): string
 | 
			
		||||
    {
 | 
			
		||||
        return this._stuffCode;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set StuffCode(stuff_code: string)
 | 
			
		||||
    {
 | 
			
		||||
        this._stuffCode = stuff_code;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public get StuffName(): string
 | 
			
		||||
    {
 | 
			
		||||
        return this._stuffName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set StuffName(stuff_name: string)
 | 
			
		||||
    {
 | 
			
		||||
        this._stuffName = stuff_name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public get P13UID(): string
 | 
			
		||||
    {
 | 
			
		||||
        return this._p13uid;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public set P13UID(p13uid: string)
 | 
			
		||||
    {
 | 
			
		||||
        this._p13uid = p13uid;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private _stuffCode: string;
 | 
			
		||||
    private _stuffName: string;
 | 
			
		||||
    private _p13uid: string;
 | 
			
		||||
    private _department_code: string;
 | 
			
		||||
    private _department_name: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export { StuffInfo };
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										43
									
								
								code/web/task_schedule/src/utils/api/localStorage.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								code/web/task_schedule/src/utils/api/localStorage.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-02-28 09:26:45
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /deskop_task_schedule/code/web/task_schedule/src/utils/localStorage/localStorage.ts
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
import { StuffInfo } from "@/data/cpicxim/StuffInfo";
 | 
			
		||||
 | 
			
		||||
const STUFF_ITEM = "STUFF_INFO";
 | 
			
		||||
 | 
			
		||||
function loadStaffInfo(): StuffInfo
 | 
			
		||||
{
 | 
			
		||||
    const stuff = new StuffInfo();
 | 
			
		||||
 | 
			
		||||
    let obj = null;
 | 
			
		||||
 | 
			
		||||
    try
 | 
			
		||||
    {
 | 
			
		||||
        obj = JSON.parse(window.localStorage.getItem(STUFF_ITEM));
 | 
			
		||||
    }
 | 
			
		||||
    catch (error)
 | 
			
		||||
    {
 | 
			
		||||
        obj = {};
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    stuff.StuffCode = obj._stuffCode || "";
 | 
			
		||||
    stuff.StuffName = obj._stuffName || "";
 | 
			
		||||
    stuff.P13UID = obj._p13uid || "";
 | 
			
		||||
 | 
			
		||||
    return stuff;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function saveStuffInfo(stuff: StuffInfo)
 | 
			
		||||
{
 | 
			
		||||
    const json = JSON.stringify(stuff);
 | 
			
		||||
 | 
			
		||||
    window.localStorage.setItem(STUFF_ITEM, json);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export { loadStaffInfo, saveStuffInfo };
 | 
			
		||||
							
								
								
									
										37
									
								
								code/web/task_schedule/src/utils/api/request.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								code/web/task_schedule/src/utils/api/request.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
			
		||||
 | 
			
		||||
import axios from "axios";
 | 
			
		||||
 | 
			
		||||
const service = axios.create(
 | 
			
		||||
    {
 | 
			
		||||
        baseURL: "",
 | 
			
		||||
        timeout: 10000,
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
//请求拦截
 | 
			
		||||
service.interceptors.request.use(
 | 
			
		||||
    (config) =>
 | 
			
		||||
    {
 | 
			
		||||
        return config;
 | 
			
		||||
    },
 | 
			
		||||
    (error) =>
 | 
			
		||||
    {
 | 
			
		||||
        console.log(error);
 | 
			
		||||
 | 
			
		||||
        return Promise.reject(error);
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
//响应拦截
 | 
			
		||||
service.interceptors.response.use(
 | 
			
		||||
    (response) =>
 | 
			
		||||
    {
 | 
			
		||||
        return response;
 | 
			
		||||
    },
 | 
			
		||||
    (error) =>
 | 
			
		||||
    {
 | 
			
		||||
        return Promise.reject(error);
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
export { service };
 | 
			
		||||
@@ -1,13 +0,0 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-02-28 09:26:45
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /deskop_task_schedule/code/web/task_schedule/src/utils/localStorage/localStorage.js
 | 
			
		||||
 * @Description: 
 | 
			
		||||
 * 
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 | 
			
		||||
 */
 | 
			
		||||
function loadStaffInfo()
 | 
			
		||||
{
 | 
			
		||||
    // const staffInfo:string = "";
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user