2025-11-26 23:25:51 +08:00
|
|
|
export type OnCallbackReq = {
|
|
|
|
|
code: string;
|
|
|
|
|
state: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type OauthToken = {
|
|
|
|
|
userInfo: {
|
|
|
|
|
openId: string;
|
|
|
|
|
nickName: string;
|
|
|
|
|
avatar: string;
|
|
|
|
|
},
|
|
|
|
|
token: {
|
|
|
|
|
accessToken: string;
|
|
|
|
|
refreshToken: string;
|
|
|
|
|
expiresIn: number;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type OnBindReq = {
|
2025-11-26 07:34:42 +08:00
|
|
|
accessToken: string;
|
|
|
|
|
refreshToken: string;
|
|
|
|
|
expiresIn: number;
|
|
|
|
|
idToken: string;
|
|
|
|
|
scope: string;
|
|
|
|
|
tokenType: string;
|
|
|
|
|
bindInfo: any;
|
2025-11-26 23:25:51 +08:00
|
|
|
}
|
|
|
|
|
export type OnBindReply = {
|
2025-11-26 07:34:42 +08:00
|
|
|
success: boolean;
|
|
|
|
|
message: string;
|
2025-11-26 23:25:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IOauthProvider {
|
|
|
|
|
buildLoginUrl: (params: { redirectUri: string }) => Promise<string>;
|
|
|
|
|
onCallback: (params: OnCallbackReq) => Promise<OauthToken>;
|
|
|
|
|
onBind: (params: OnBindReq) => Promise<OnBindReply>;
|
2025-11-26 07:34:42 +08:00
|
|
|
}
|