完成登录功能

This commit is contained in:
2023-03-02 19:48:08 +08:00
parent 1ef1329495
commit e8c230211b
6 changed files with 195 additions and 107 deletions

View File

@@ -12,7 +12,7 @@ import { service as instance } from "@/utils/api/request";
import { API_URL } from "@/utils/api/config";
interface LoginInfo
{
account: string;
p13account: string;
password: string;
}

View File

@@ -2,19 +2,17 @@
* @Author: Kane
* @Date: 2023-02-28 09:26:45
* @LastEditors: Kane
* @FilePath: /deskop_task_schedule/code/web/task_schedule/src/utils/localStorage/localStorage.ts
* @FilePath: /task_schedule/src/utils/api/localStorage.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { StuffInfo } from "@/data/cpicxim/StuffInfo";
import { StaffInfo } from "@/data/cpicxim/StaffInfo";
const STUFF_ITEM = "STUFF_INFO";
const STUFF_ITEM = "stuff_info";
function loadStaffInfo(): StuffInfo
function loadStaffInfo(): StaffInfo
{
const stuff = new StuffInfo();
let obj = null;
try
@@ -26,18 +24,24 @@ function loadStaffInfo(): StuffInfo
obj = {};
}
stuff.StuffCode = obj._stuffCode || "";
stuff.StuffName = obj._stuffName || "";
stuff.P13UID = obj._p13uid || "";
const stuff = new StaffInfo(
obj._p13uid || "",
obj._stuffCode || "",
obj._stuffName || "",
obj._department_code || "",
obj._department_name || "",
obj._section_office_code || "",
obj._section_office_name || "");
return stuff;
}
function saveStuffInfo(stuff: StuffInfo)
function saveStaffInfo(stuff: StaffInfo)
{
const json = JSON.stringify(stuff);
window.localStorage.setItem(STUFF_ITEM, json);
};
export { loadStaffInfo, saveStuffInfo };
export { loadStaffInfo, saveStaffInfo };