mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
31 lines
616 B
TypeScript
31 lines
616 B
TypeScript
import { Factory } from 'miragejs'
|
|
import { faker } from '@faker-js/faker'
|
|
|
|
import type { User } from '@/models/user'
|
|
|
|
export const seedUser = () => {
|
|
return Factory.extend<Partial<User>>({
|
|
firstName() {
|
|
return faker.name.firstName()
|
|
},
|
|
lastName() {
|
|
return faker.name.lastName()
|
|
},
|
|
name() {
|
|
return faker.address.streetAddress()
|
|
},
|
|
phone() {
|
|
return faker.phone.number()
|
|
},
|
|
email() {
|
|
return faker.internet.email()
|
|
},
|
|
username() {
|
|
return faker.internet.userName()
|
|
},
|
|
avatar() {
|
|
return faker.internet.avatar()
|
|
},
|
|
})
|
|
}
|