import { ContentTypeEnum } from '@vben/request';
|
|
import { defHttp } from '#/api/request';
|
import { getJnpfAppEnCode, getRealJnpfAppEnCode } from '#/utils/jnpf';
|
|
enum Api {
|
Prefix = '/api/oauth',
|
}
|
|
/**
|
* 获取用户信息
|
*/
|
export async function getUserInfoApi() {
|
const isBackend = getJnpfAppEnCode() === getRealJnpfAppEnCode() ? 0 : 1;
|
return defHttp.get({ url: `${Api.Prefix}/CurrentUser`, data: { systemCode: getRealJnpfAppEnCode(), isBackend } });
|
}
|
// 锁屏解锁登录
|
export function unlockApi(data: any) {
|
return defHttp.post({ url: `${Api.Prefix}/LockScreen`, data });
|
}
|
// 获取系统默认配置
|
export function getConfig(account: string) {
|
return defHttp.get({ url: `${Api.Prefix}/getConfig/${account}` });
|
}
|
// 修改密码信息发送
|
export function updatePasswordMessage() {
|
return defHttp.post({ url: `${Api.Prefix}/updatePasswordMessage` });
|
}
|
// 获取登录配置
|
export function getLoginConfig() {
|
return defHttp.get({ url: `${Api.Prefix}/getLoginConfig` });
|
}
|
// 获取登录票据
|
export function getTicket() {
|
return defHttp.get({ url: `${Api.Prefix}/getTicket` });
|
}
|
// 根据票据获取登录状态
|
export function getTicketStatus(ticket: string) {
|
return defHttp.get({ url: `${Api.Prefix}/getTicketStatus/${ticket}` });
|
}
|
// 第三方登录回调列表后点击登录
|
export function socialsLogin(params: any) {
|
return defHttp.post({ url: `${Api.Prefix}/Login/socials`, params, headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED } });
|
}
|
// 扫码登陆获取凭证
|
export function getCodeCertificate() {
|
return defHttp.get({ url: `${Api.Prefix}/codeCertificate` });
|
}
|
// 扫码登陆获取凭证状态
|
export function getCodeCertificateStatus(ticket: string) {
|
return defHttp.get({ url: `${Api.Prefix}/codeCertificateStatus/${ticket}` });
|
}
|
// 扫码登陆设置凭证状态
|
export function setCodeCertificateStatus(ticket: string, status: string) {
|
return defHttp.get({ url: `${Api.Prefix}/setCodeCertificateStatus/${ticket}/${status}` });
|
}
|