This commit is contained in:
2023-02-28 18:48:14 +08:00
parent e8996c3fbf
commit e49f4426f3
10 changed files with 323 additions and 56 deletions

View 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 };

View 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 };

View File

@@ -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 = "";
}