chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -42,20 +42,20 @@ import type {
|
||||
} from './types';
|
||||
|
||||
/**
|
||||
* 获取当前主题
|
||||
* Get the current topic
|
||||
*/
|
||||
export declare function useCurrentTheme(): ThemeType;
|
||||
|
||||
//------- Passport
|
||||
/**
|
||||
* 退出登录
|
||||
* log out
|
||||
*/
|
||||
export declare function logoutOnly(): Promise<void>;
|
||||
|
||||
/**
|
||||
* 上传用户头像
|
||||
* @param file - 头像文件
|
||||
* @returns web_uri - 头像文件对应的 url
|
||||
* Upload user avatar
|
||||
* @param file - avatar file
|
||||
* @Returns web_uri - URL for avatar file
|
||||
*/
|
||||
export declare function uploadAvatar(file: File): Promise<{ web_uri: string }>;
|
||||
//-------
|
||||
@@ -63,87 +63,87 @@ export declare function uploadAvatar(file: File): Promise<{ web_uri: string }>;
|
||||
//------- User
|
||||
|
||||
/**
|
||||
* 刷新用户信息
|
||||
* Refresh user information
|
||||
*/
|
||||
export declare function refreshUserInfo(): Promise<void>;
|
||||
|
||||
/**
|
||||
* 获取登录状态
|
||||
* @returns LoginStatus - 检查中/已登录/未登录
|
||||
* Get login status
|
||||
* @returns LoginStatus - checking/logged in/not logged in
|
||||
*/
|
||||
export declare function getLoginStatus(): LoginStatus;
|
||||
|
||||
/**
|
||||
* 获取登录校验是否完成
|
||||
* @returns boolean 登录校验是否完成
|
||||
* Get whether the login verification is complete
|
||||
* @Returns boolean login verification completed
|
||||
*/
|
||||
export declare function getIsSettled(): boolean;
|
||||
|
||||
/**
|
||||
* 获取是否登录,如需要获取真实登录状态,请配合 getIsSettled/useIsSettled 使用
|
||||
* @deprecated - 推荐使用 getLoginStatus
|
||||
* @returns boolean 是否登录
|
||||
* Get whether to log in. If you need to get the real login status, please use it with getIsSettled/useIsSettled
|
||||
* @deprecated - recommended getLoginStatus
|
||||
* @returns boolean whether to log in
|
||||
*/
|
||||
export declare function getIsLogined(): boolean;
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
* @returns UserInfo | null - 用户信息
|
||||
* Acquire user information
|
||||
* @returns UserInfo | null - user information
|
||||
*/
|
||||
export declare function getUserInfo(): UserInfo | null;
|
||||
|
||||
/**
|
||||
* 获取用户三方授权信息
|
||||
* Obtain user tripartite authorization information
|
||||
* @returns Promise<void>
|
||||
*/
|
||||
export declare function getUserAuthInfos(): Promise<void>;
|
||||
|
||||
/**
|
||||
* 响应式获取登录状态
|
||||
* @returns LoginStatus - 检查中/已登录/未登录
|
||||
* Responsive access to login status
|
||||
* @returns LoginStatus - checking/logged in/not logged in
|
||||
*/
|
||||
export declare function useLoginStatus(): LoginStatus;
|
||||
|
||||
/**
|
||||
* 响应式获取登录校验是否完成
|
||||
* @returns boolean 登录校验是否完成
|
||||
* Responsive Get Login Verification Completed
|
||||
* @Returns boolean login verification completed
|
||||
*/
|
||||
export declare function useIsSettled(): boolean;
|
||||
|
||||
/**
|
||||
* 响应式获取是否登录,如需要获取真实登录状态,请配合 getIsSettled/useIsSettled 使用
|
||||
* @deprecated - 推荐使用 useLoginStatus
|
||||
* @returns boolean 是否登录
|
||||
* Responsive to get whether to log in. If you need to get the real login status, please use it with getIsSettled/useIsSettled
|
||||
* @deprecated - useLoginStatus
|
||||
* @returns boolean whether to log in
|
||||
*/
|
||||
export declare function useIsLogined(): boolean;
|
||||
|
||||
/**
|
||||
* 响应式获取用户信息
|
||||
* @returns UserInfo | null - 用户信息
|
||||
* Responsive acquisition of user information
|
||||
* @returns UserInfo | null - user information
|
||||
*/
|
||||
export declare function useUserInfo(): UserInfo | null;
|
||||
|
||||
/**
|
||||
* 响应式获取用户三方授权信息
|
||||
* Responsive acquisition of user tripartite authorization information
|
||||
* @returns UserAuthInfo[]
|
||||
*/
|
||||
export declare function useUserAuthInfo(): UserAuthInfo[];
|
||||
|
||||
/**
|
||||
* 响应式获取用户用户标签
|
||||
* Responsive acquisition of user tags
|
||||
* @returns UserLabel
|
||||
*/
|
||||
export declare function useUserLabel(): UserLabel | null;
|
||||
|
||||
/**
|
||||
* 订阅 UserAuthInfo 变化
|
||||
* @param callback - 回调函数
|
||||
* Subscribe to UserAuthInfo Changes
|
||||
* @param callback - callback function
|
||||
*/
|
||||
export declare function subscribeUserAuthInfos(
|
||||
callback: (state: UserAuthInfo[], prev: UserAuthInfo[]) => void,
|
||||
): () => void;
|
||||
|
||||
//------- layout组件
|
||||
//------- layout component
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export declare const SideSheetMenu: FC;
|
||||
@@ -163,6 +163,6 @@ export interface MenuItem {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据spaceId获取space信息
|
||||
* Get space information based on spaceId
|
||||
*/
|
||||
export declare function useSpace(spaceId: string): BotSpace | undefined;
|
||||
|
||||
@@ -18,18 +18,18 @@ export interface BackButtonProps {
|
||||
onClickBack: () => void;
|
||||
}
|
||||
|
||||
/** 导航栏自定义按钮属性 */
|
||||
/** Navigation bar custom button properties */
|
||||
export interface NavBtnProps {
|
||||
// 必填,Nav.Item导航组件唯一key,路由匹配时高亮
|
||||
// Required, Nav. Item navigation component unique key, highlighted when the route matches
|
||||
navKey: string;
|
||||
//按钮图标
|
||||
//button icon
|
||||
icon?: React.ReactNode;
|
||||
// 按钮名称
|
||||
// button name
|
||||
label: string | React.ReactNode;
|
||||
// 后缀节点
|
||||
// Suffix Node
|
||||
suffix?: string | React.ReactNode;
|
||||
// 仅在左侧导航栏默认模式中展示
|
||||
// Show only in the default mode of the left navigation bar
|
||||
onlyShowInDefault?: boolean;
|
||||
// 按钮点击回调
|
||||
// Button click callback
|
||||
onClick: (e: React.MouseEvent) => void;
|
||||
}
|
||||
|
||||
@@ -15,34 +15,34 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* 代表OAuth2回调的access_token的用途,目前有:
|
||||
* 1.login:登陆时进行用户中台三方登陆(auth/login)
|
||||
* 2. delete_account:删除账号时获取ticket(auth/authorize)
|
||||
* 3. oauth: 发布三方平台是时获取用户授权
|
||||
* The uses of the access_token representing the OAuth2 callback are currently:
|
||||
* 1. Login: When logging in, perform user mid-platform three-party login (auth/login)
|
||||
* 2. delete_account: Get ticket when deleting account (auth/authorized)
|
||||
* 3.Oauth: It is time to obtain user authorization when releasing the three-party platform
|
||||
*/
|
||||
export type OAuth2StateType = 'login' | 'delete_account' | 'oauth';
|
||||
|
||||
export interface OAuth2RedirectConfig {
|
||||
/**
|
||||
* 最终的OAuth2鉴权信息将作为路由参数跳转,这个参数指定目标路由地址,注意在目标路由上使用
|
||||
* useAuthLoginDataRouteFromOAuth2来提取路由参数,并转换成用户中台三方登陆服务(authLogin)的参数;
|
||||
* 默认值为当前路径名称,即不传navigatePath参数时,当前路由一定要注册useAuthLoginDataRouteFromOAuth2才有效
|
||||
* The final OAuth2 authentication information will be redirected as a route parameter, which specifies the target route address. Be careful to use it on the target route
|
||||
* useAuthLoginDataRouteFromOAuth2 to extract the routing parameters and convert them into the parameters of the user's mid-platform three-party login service (authLogin);
|
||||
* The default value is the current path name, that is, when the navigatePath parameter is not passed, the current route must be registered useAuthLoginDataRouteFromOAuth2 to be valid
|
||||
*/
|
||||
navigatePath?: string;
|
||||
/**
|
||||
* OAuth2回调后拿到的鉴权信息的使用场景,用于在一些路由组件中区分,不符合对应场景的不能用于消费
|
||||
* The usage scenario of the authentication information obtained after the OAuth2 callback is used to distinguish among some routing components. Those that do not meet the corresponding scenario cannot be used for consumption
|
||||
*/
|
||||
type: OAuth2StateType;
|
||||
/**
|
||||
* 传递给OAuth2服务器的state字段,会在回调时传回,用于恢复网页状态
|
||||
* The state field passed to the OAuth2 server is returned during the callback to restore the state of the webpage
|
||||
*/
|
||||
|
||||
extra?: {
|
||||
// @ts-expect-error -- linter-disable-autofix
|
||||
origin?: string;
|
||||
[x: string]: string; // 用于安全监测
|
||||
[x: string]: string; // For safety monitoring
|
||||
// @ts-expect-error -- linter-disable-autofix
|
||||
encrypt_state?: string; //加密state,bind_type 为 4时使用
|
||||
encrypt_state?: string; //Encrypted state, used when bind_type 4
|
||||
};
|
||||
scope?: string;
|
||||
optionalScope?: string;
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface UserConnectItem {
|
||||
export interface UserInfo {
|
||||
app_id: number;
|
||||
/**
|
||||
* @deprecated 会因为溢出丢失精度,使用 user_id_str
|
||||
* @Deprecated will lose precision due to overflow, use user_id_str
|
||||
*/
|
||||
user_id: number;
|
||||
user_id_str: string;
|
||||
@@ -102,14 +102,14 @@ export interface UserInfo {
|
||||
};
|
||||
need_check_bind_status: boolean;
|
||||
bui_audit_info?: {
|
||||
// TODO 这里的类型定义需要再明确一点更好
|
||||
// The type definition here in TODO needs to be more clear and better
|
||||
audit_info: {
|
||||
user_unique_name?: string;
|
||||
avatar_url?: string;
|
||||
name?: string;
|
||||
[key: string]: unknown;
|
||||
}; // Record<string, unknown>;
|
||||
// int值。1审核中,2审核通过,3审核不通过
|
||||
// int value. 1 During the review, 2 passed the review, and 3 failed the review.
|
||||
audit_status: 1 | 2 | 3;
|
||||
details: Record<string, unknown>;
|
||||
is_auditing: boolean;
|
||||
|
||||
Reference in New Issue
Block a user