chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -36,10 +36,10 @@ import {
|
||||
} from '@coze-arch/bot-api';
|
||||
|
||||
interface AuthStoreState {
|
||||
/* 两层map
|
||||
/* Two layer map
|
||||
{
|
||||
资源类型: {
|
||||
资源ID: 协作者
|
||||
Resource Type: {
|
||||
Resource ID: Collaborator
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -78,15 +78,15 @@ interface AuthStoreAction {
|
||||
resource: ResourceIdentifier;
|
||||
users: Creator[];
|
||||
options?: BotAPIRequestConfig;
|
||||
// 第三个参数是error code
|
||||
// The third argument is the error code
|
||||
roles?: Array<CollaboratorType>;
|
||||
}) => Promise<[Creator[], Creator[], number]>;
|
||||
// permission 服务新增的批量添加接口
|
||||
// New batch addition interface for permission service
|
||||
batchAddCollaboratorsServer: (params: {
|
||||
resource: ResourceIdentifier;
|
||||
users: Creator[];
|
||||
options?: BotAPIRequestConfig;
|
||||
// 第三个参数是error code
|
||||
// The third argument is the error code
|
||||
roles?: Array<CollaboratorType>;
|
||||
}) => Promise<boolean>;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ export const useAuthStore = create<AuthStoreState & AuthStoreAction>()(
|
||||
},
|
||||
}));
|
||||
},
|
||||
// 暂时由前端批量处理
|
||||
// Temporarily batch processed by the front end
|
||||
batchRemoveCollaborators: async (resource, userIds, options) => {
|
||||
const resultArr = await Promise.all(
|
||||
userIds.map(
|
||||
@@ -343,14 +343,14 @@ export const useAuthStore = create<AuthStoreState & AuthStoreAction>()(
|
||||
),
|
||||
),
|
||||
);
|
||||
// 目前的批量实现需要对单个添加的接口的code进行排序,拿到最高优先级的message来透出
|
||||
// Current batch implementations need to sort the code of individual added interfaces to get the highest priority message to reveal
|
||||
let errorCode = 0;
|
||||
const [addedUsers, failedUsers] = resultArr.reduce<
|
||||
[Creator[], Creator[]]
|
||||
>(
|
||||
([r, f], finish, index) => {
|
||||
const user = users[index];
|
||||
// 这么写是为了ts能正确类型推导。ts@5.0.4
|
||||
// This is written so that ts can derive the correct type. ts@5.0.4
|
||||
if (finish.result === true) {
|
||||
return [[...r, user], f];
|
||||
}
|
||||
@@ -360,12 +360,12 @@ export const useAuthStore = create<AuthStoreState & AuthStoreAction>()(
|
||||
message?: string;
|
||||
msg?: string;
|
||||
};
|
||||
// 比较code
|
||||
// Comparison code
|
||||
if (Number(error.code) > errorCode) {
|
||||
errorCode = Number(error.code);
|
||||
}
|
||||
}
|
||||
// 错误时,需要比较code然后复制message
|
||||
// Error, you need to compare the code and then copy the message
|
||||
return [r, [...f, user]];
|
||||
},
|
||||
[[], []],
|
||||
|
||||
@@ -33,7 +33,7 @@ declare namespace DataItem {
|
||||
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;
|
||||
@@ -109,7 +109,7 @@ declare namespace DataItem {
|
||||
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: number;
|
||||
details: Record<string, unknown>;
|
||||
is_auditing: boolean;
|
||||
@@ -119,7 +119,7 @@ declare namespace DataItem {
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送验证码的返回数据结构
|
||||
* The return data structure for sending the verification code
|
||||
*/
|
||||
interface SendCodeData {
|
||||
mobile: string;
|
||||
|
||||
@@ -15,17 +15,17 @@
|
||||
*/
|
||||
|
||||
export {
|
||||
/** @deprecated 该使用方式已废弃,后续请使用@coze-arch/foundation-sdk导出的方法*/
|
||||
/** @Deprecated This usage method is deprecated, please use the method exported by @code-arch/foundation-sdk in the future*/
|
||||
useSpaceStore,
|
||||
/** @deprecated 该使用方式已废弃,后续请使用@coze-arch/foundation-sdk导出的方法*/
|
||||
/** @Deprecated This usage method is deprecated, please use the method exported by @code-arch/foundation-sdk in the future*/
|
||||
useSpace,
|
||||
/** @deprecated 该使用方式已废弃,后续请使用@coze-arch/foundation-sdk导出的方法*/
|
||||
/** @Deprecated This usage method is deprecated, please use the method exported by @code-arch/foundation-sdk in the future*/
|
||||
useSpaceList,
|
||||
} from '@coze-foundation/space-store';
|
||||
|
||||
export { useAuthStore } from './auth';
|
||||
|
||||
/** @deprecated - 持久化方案有问题,废弃 */
|
||||
/** @Deprecated - problem with persistence scheme, deprecated */
|
||||
export { clearStorage } from './utils/get-storage';
|
||||
|
||||
export { useSpaceGrayStore, TccKey } from './space-gray';
|
||||
|
||||
@@ -58,7 +58,7 @@ const fetchTccConfig = async spaceId => {
|
||||
}
|
||||
};
|
||||
|
||||
/* 通过 tcc 动态配置的 space 粒度的灰度 */
|
||||
/* Dynamically configured grey release of space granularity via tcc */
|
||||
export const useSpaceGrayStore = create<TccStore & TccAction>()(
|
||||
devtools(
|
||||
(set, get) => ({
|
||||
|
||||
@@ -26,7 +26,7 @@ const instance = localForage.createInstance({
|
||||
const throttleTime = 1000;
|
||||
|
||||
/**
|
||||
* 获取store数据持久化引擎
|
||||
* Get stored data persistence engine
|
||||
*/
|
||||
export const getStorage = (): StateStorage => {
|
||||
const persistStorage: StateStorage = {
|
||||
@@ -42,5 +42,5 @@ export const getStorage = (): StateStorage => {
|
||||
return persistStorage;
|
||||
};
|
||||
|
||||
/** @deprecated - 持久化方案有问题,废弃 */
|
||||
/** @Deprecated - problem with persistence scheme, deprecated */
|
||||
export const clearStorage = instance.clear;
|
||||
|
||||
Reference in New Issue
Block a user