ny
23 小时以前 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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}` });
}