bug修复
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
28
src/services/jobportal/auth.ts
Normal file
28
src/services/jobportal/auth.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
export type SsoCodeLoginData = { token: string; lcToken: string };
|
||||
export type SsoCodeLoginResult = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: SsoCodeLoginData;
|
||||
};
|
||||
|
||||
const ssoCodeLoginRequest = (url: string, code: string) =>
|
||||
request<SsoCodeLoginResult>(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
isToken: false,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
data: { code },
|
||||
});
|
||||
|
||||
/** 经办端:POST /sso/pcms/code/login */
|
||||
export async function getTjmhToken(code: string) {
|
||||
return ssoCodeLoginRequest('/api/sso/pcms/code/login', code);
|
||||
}
|
||||
|
||||
/** 互联网端:POST /sso/pc/code/login */
|
||||
export async function getWwTjmHlwToken(code: string) {
|
||||
return ssoCodeLoginRequest('/api/sso/pc/code/login', code);
|
||||
}
|
||||
Reference in New Issue
Block a user