forked from tookit/vue-material-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.js
35 lines (32 loc) · 982 Bytes
/
user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const Faker = require('faker');
const range = (start, end) => new Array(end - start).fill(start).map((el, i) => start + i);
const randomInt = (max) => Math.floor(Math.random() * max) + 1;
const users = range(0, 20).map(() => {
let name = Faker.name.firstName();
let userName = Faker.internet.userName(name);
return {
'uid': Faker.random.uuid(),
'name': name,
'email': Faker.internet.email(userName),
'username': userName,
'phone': Faker.phone.phoneNumber(),
'avatar': Faker.image.avatar(),
'address': {
'street': Faker.address.streetAddress(),
'suite': Faker.address.secondaryAddress(),
'city': Faker.address.city(),
'state': Faker.address.state(),
'country': Faker.address.country(),
'zipcode': Faker.address.zipCode(),
'geo': {
'lat': Faker.address.latitude(),
'lng': Faker.address.longitude()
}
},
};
});
module.exports = () => {
return {
data: users
};
};