Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 4d1408f

Browse files
committed
fix(auth): 修复一处类型错误
1 parent 36449c7 commit 4d1408f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/models/platform/github/repo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class Repo extends Base {
105105
* @param options.page - 页码 默认值:1
106106
* @returns 仓库详细信息
107107
*/
108-
public async get_user_repos_list_by_token (options?: RepoListBaseParmsType) {
108+
public async get_user_repos_list_by_token (options?: RepoListBaseParmsType): Promise<ApiResponseType<RepoInfoResponseType>> {
109109
try {
110110
this.setRequestConfig({
111111
token: this.userToken

src/types/platform/github/auth.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ export interface GithubOauthTokenResponseType {
1515
/** 用户访问令牌, 格式为 ghu_ 开头 */
1616
access_token: string;
1717
/** access_token 过期前的秒数,默认值为 28800(8小时) */
18-
expires_in: number;
19-
/** 刷新令牌,格式为 ghr_ 开头,可能为 undefined */
20-
refresh_token: string | undefined;
21-
/** refresh_token 过期前的秒数,默认值为 15897600(6个月),可能为 undefined */
22-
refresh_token_expires_in: number | undefined;
18+
expires_in: number | null;
19+
/** 刷新令牌,格式为 ghr_ 开头,可能为 null */
20+
refresh_token: `ghr_${string}` | null;
21+
/** refresh_token 过期前的秒数,默认值为 15897600(6个月) */
22+
refresh_token_expires_in: number | null;
2323
/** 令牌范围,默认是空字符串 */
2424
scope: string;
2525
/** 令牌类型,始终为 'bearer' */
@@ -35,11 +35,11 @@ export interface GithubOauthRefreshTokenResponseType {
3535
/** 用户访问令牌,格式为 ghu_ 开头 */
3636
access_token: string;
3737
/** access_token 过期前的秒数,默认值为 28800(8小时) */
38-
expires_in: number;
39-
/** 刷新令牌,格式为 ghr_ 开头,可能为 undefined */
40-
refresh_token: string | undefined;
41-
/** refresh_token 过期前的秒数,默认值为 15897600(6个月),可能为 undefined */
42-
refresh_token_expires_in: number | undefined;
38+
expires_in: number | null;
39+
/** 刷新令牌,格式为 ghr_ 开头,可能为 null */
40+
refresh_token: `ghr_${string}` | null;
41+
/** refresh_token 过期前的秒数,默认值为 15897600(6个月),可能为 null */
42+
refresh_token_expires_in: number | null;
4343
/** 令牌范围,默认是空字符串 */
4444
scope: string;
4545
/** 令牌类型,始终为 'bearer' */

0 commit comments

Comments
 (0)