diff --git a/packages/plugins/@nocobase/plugin-mock-collections/src/server/field-interfaces/email.ts b/packages/plugins/@nocobase/plugin-mock-collections/src/server/field-interfaces/email.ts index 628cfbeba0..f293994c3b 100644 --- a/packages/plugins/@nocobase/plugin-mock-collections/src/server/field-interfaces/email.ts +++ b/packages/plugins/@nocobase/plugin-mock-collections/src/server/field-interfaces/email.ts @@ -1,4 +1,5 @@ import { faker } from '@faker-js/faker'; +import { uid } from '@nocobase/utils'; export const email = { options: () => ({ @@ -11,5 +12,5 @@ export const email = { 'x-validator': 'email', }, }), - mock: () => faker.internet.email(), + mock: () => faker.internet.email({ lastName: uid() }), }; diff --git a/packages/plugins/@nocobase/plugin-mock-collections/src/server/index.ts b/packages/plugins/@nocobase/plugin-mock-collections/src/server/index.ts index c382afe209..477aac4c07 100644 --- a/packages/plugins/@nocobase/plugin-mock-collections/src/server/index.ts +++ b/packages/plugins/@nocobase/plugin-mock-collections/src/server/index.ts @@ -222,7 +222,14 @@ export class PluginMockCollectionsServer extends Plugin { size = values.length; } const data = await mockCollectionData(resourceName, size); - // ctx.body = data; + // ctx.body = { + // values: (Array.isArray(data) ? data : [data]).map((item, index) => { + // if (Array.isArray(values)) { + // return { ...item, ...values[index] }; + // } + // return { ...item, ...values }; + // }), + // }; ctx.body = await repository.create({ values: (Array.isArray(data) ? data : [data]).map((item, index) => { if (Array.isArray(values)) {