Files
desktop_task_schedule/code/web/task_schedule/src/test/requestTest.ts

51 lines
1002 B
TypeScript
Raw Normal View History

2025-09-03 15:29:46 +08:00
import { type AxiosResponse } from "axios";
import { service as instance } from "../utils/api/request.js";
import { API_URL } from "../utils/api/config.js";
// import { login, loginCaller, type LoginCallerInfo } from "../utils/account.js";
interface LoginInfo
{
p13account: string;
password: string;
}
interface LoginCallerInfo
{
telsaler_code: string;
}
async function loginCaller( data: LoginCallerInfo ): Promise<AxiosResponse<any, any>>
{
return await instance.request(
{
method: "post",
url: API_URL.URL_LOGIN_CALLER,
data,
});
}
function loginTestCaller(): void
{
const info: LoginCallerInfo =
{
telsaler_code: "61136",
};
loginCaller( info )
.then(( response ) =>
{
console.log( response.data );
})
.catch(( error ) =>
{
console.log( error );
});
}
export {
loginTestCaller,
type LoginInfo,
type LoginCallerInfo
};