mediahub-fe/service/auth.ts

39 lines
960 B
TypeScript
Raw Normal View History

2025-01-02 05:13:05 +00:00
import qs from "qs";
import { getAPIDummy } from "./http-config/axiosCustom";
2025-01-01 17:48:57 +00:00
import { httpPost } from "./http-config/http-base-service";
import {
2025-01-01 17:48:57 +00:00
httpGetInterceptor,
httpGetInterceptorWithToken,
httpPostInterceptor,
} from "./http-config/http-interceptor-service";
2025-01-01 17:48:57 +00:00
export async function login(data: any) {
const pathUrl = "signin";
2025-01-02 05:13:05 +00:00
const headers = {
'content-type': 'application/x-www-form-urlencoded',
};
return httpPost(pathUrl, headers, qs.stringify(data));
}
export async function getProfile(token: any) {
const url = "users/info";
2025-01-01 17:48:57 +00:00
return httpGetInterceptorWithToken(url, token);
}
2024-12-26 11:29:22 +00:00
export async function getInfoProfile() {
const url = "users/info";
2025-01-01 17:48:57 +00:00
return httpGetInterceptor(url);
2024-12-26 11:29:22 +00:00
}
export async function setupPassword(data: any) {
const url = "setup-password";
2025-01-01 17:48:57 +00:00
return httpPostInterceptor(url, data);
2024-12-26 11:29:22 +00:00
}
export async function saveUser(data: any) {
const url = "users/save";
2025-01-01 17:48:57 +00:00
return httpPostInterceptor(url, data);
2024-12-26 11:29:22 +00:00
}