refactor:基于 lint 处理排版

This commit is contained in:
YunaiV
2025-04-22 22:10:33 +08:00
parent 3fe36fd823
commit fb785894b6
322 changed files with 4781 additions and 2093 deletions

View File

@@ -1,20 +1,25 @@
import { requestClient } from '#/api/request';
/** OAuth2.0 授权信息响应 */
export interface OAuth2OpenAuthorizeInfoRespVO {
client: {
name: string;
logo: string;
};
scopes: {
key: string;
value: boolean;
}[];
export namespace SystemOAuth2ClientApi {
/** 授权信息 */
export interface AuthorizeInfoRespVO {
client: {
logo: string;
name: string;
};
scopes: {
key: string;
value: boolean;
}[];
}
}
/** 获得授权信息 */
export function getAuthorize(clientId: string) {
return requestClient.get<OAuth2OpenAuthorizeInfoRespVO>(`/system/oauth2/authorize?clientId=${clientId}`);
return requestClient.get<SystemOAuth2ClientApi.AuthorizeInfoRespVO>(
`/system/oauth2/authorize?clientId=${clientId}`,
);
}
/** 发起授权 */
@@ -25,7 +30,7 @@ export function authorize(
state: string,
autoApprove: boolean,
checkedScopes: string[],
uncheckedScopes: string[]
uncheckedScopes: string[],
) {
// 构建 scopes
const scopes: Record<string, boolean> = {};
@@ -35,19 +40,19 @@ export function authorize(
for (const scope of uncheckedScopes) {
scopes[scope] = false;
}
// 发起请求
return requestClient.post<string>('/system/oauth2/authorize', null, {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/x-www-form-urlencoded',
},
params: {
response_type: responseType,
client_id: clientId,
redirect_uri: redirectUri,
state: state,
state,
auto_approve: autoApprove,
scope: JSON.stringify(scopes)
}
scope: JSON.stringify(scopes),
},
});
}
}