chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -15,44 +15,44 @@
*/
/**
* 空间相关的权限点枚举
* Spatially dependent permission spot enumeration
*/
export enum ESpacePermisson {
/**
* 更新空间
* update space
*/
UpdateSpace,
/**
* 删除空间
* delete space
*/
DeleteSpace,
/**
* 添加成员
* Add member
*/
AddBotSpaceMember,
/**
* 移除空间成员
* Remove space member
*/
RemoveSpaceMember,
/**
* 退出空间
* exit space
*/
ExitSpace,
/**
* 转移owner权限
* Transfer owner permissions
*/
TransferSpace,
/**
* 更新成员
* update member
*/
UpdateSpaceMember,
/**
* 管理API-KEY
* Manage API-KEY
*/
API,
}
/**
* 空间角色枚举
* Spatial Role Enumeration
*/
export { SpaceRoleType } from '@coze-arch/idl/developer_api';

View File

@@ -19,26 +19,26 @@ import { create } from 'zustand';
import { type SpaceRoleType } from '@coze-arch/idl/developer_api';
interface SpaceAuthStoreState {
// 每一个空间的角色数据
// Role data for each space
roles: {
[spaceId: string]: SpaceRoleType[];
};
// 每一个空间的角色数据的初始化状态,是否完成初始化。
// The initialization status of the character data in each space, and whether the initialization is completed.
isReady: {
[spaceId: string]: boolean;
};
}
interface SpaceAuthStoreAction {
// 设置spaceId对应的空间的角色
// Set the role of the space corresponding to the spaceId
setRoles: (spaceId: string, roles: SpaceRoleType[]) => void;
// 设置spaceId对应的空间的数据是否ready
// Set whether the data of the space corresponding to the spaceId is ready
setIsReady: (spaceId: string, isReady: boolean) => void;
// 回收空间数据
// Recovering spatial data
destory: (spaceId) => void;
}
/**
* SpaceAuthStore设计成支持多空间切换维护多个空间的数据位置因为空间切换时序导致的bug。
* SpaceAuthStore is designed to support multi-space switching and maintain data in multiple spaces. The location is due to bugs caused by the timing of space switching.
*/
export const useSpaceAuthStore = create<
SpaceAuthStoreState & SpaceAuthStoreAction

View File

@@ -23,7 +23,7 @@ export function useDestorySpace(spaceId: string) {
return useEffect(
() => () => {
// 空间组件销毁时清空对应space数据
// When the space component is destroyed, empty the corresponding space data
destorySpace(spaceId);
},
[],

View File

@@ -19,8 +19,8 @@ import { type ESpacePermisson } from './constants';
import { calcPermission } from './calc-permission';
export function useSpaceAuth(key: ESpacePermisson, spaceId: string) {
// 获取space role信息
// Get space role information
const role = useSpaceRole(spaceId);
// 计算权限点
// Calculate permission spot
return calcPermission(key, role);
}

View File

@@ -20,7 +20,7 @@ import { useSpace } from '@coze-arch/foundation-sdk';
import { useSpaceAuthStore } from './store';
export function useSpaceRole(spaceId: string) {
// 获取space信息,已有hook
// Get space information, there are hooks.
const space = useSpace(spaceId);
if (!space) {