desktop_task_schedule/code/web/task_schedule/src/utils/account.ts

32 lines
673 B
TypeScript
Raw Normal View History

2023-03-02 08:59:48 +00:00
/*
* @Author: Kane
* @Date: 2023-03-02 14:48:35
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/account.ts
2023-03-06 03:22:43 +00:00
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
2023-03-02 08:59:48 +00:00
*/
2023-03-06 03:22:43 +00:00
import { type AxiosResponse } from "axios";
2023-03-07 09:54:52 +00:00
import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js";
2023-03-02 08:59:48 +00:00
interface LoginInfo
{
2023-03-02 11:48:08 +00:00
p13account: string;
2023-03-02 08:59:48 +00:00
password: string;
}
2023-03-17 10:53:13 +00:00
async function login( data: LoginInfo ): Promise<AxiosResponse<any, any>>
2023-03-02 08:59:48 +00:00
{
2023-03-06 03:22:43 +00:00
return await instance.request(
2023-03-02 08:59:48 +00:00
{
method: "post",
url: API_URL.URL_LOGIN,
2023-03-06 03:22:43 +00:00
data,
2023-03-02 08:59:48 +00:00
}
);
}
2023-03-06 03:22:43 +00:00
export { type LoginInfo, login };