|
@@ -1,6 +1,15 @@
|
|
import { MockMethod } from 'vite-plugin-mock';
|
|
import { MockMethod } from 'vite-plugin-mock';
|
|
|
|
+import { Random } from 'mockjs';
|
|
import { resultPageSuccess } from '../_util';
|
|
import { resultPageSuccess } from '../_util';
|
|
|
|
|
|
|
|
+function getRandomPics(count = 10): string[] {
|
|
|
|
+ const arr: string[] = [];
|
|
|
|
+ for (let i = 0; i < count; i++) {
|
|
|
|
+ arr.push(Random.image('800x600', Random.color(), Random.color(), Random.title()));
|
|
|
|
+ }
|
|
|
|
+ return arr;
|
|
|
|
+}
|
|
|
|
+
|
|
const demoList = (() => {
|
|
const demoList = (() => {
|
|
const result: any[] = [];
|
|
const result: any[] = [];
|
|
for (let index = 0; index < 60; index++) {
|
|
for (let index = 0; index < 60; index++) {
|
|
@@ -18,6 +27,9 @@ const demoList = (() => {
|
|
name6: '@cname()',
|
|
name6: '@cname()',
|
|
name7: '@cname()',
|
|
name7: '@cname()',
|
|
name8: '@cname()',
|
|
name8: '@cname()',
|
|
|
|
+ avatar: Random.image('400x400', Random.color(), Random.color(), Random.first()),
|
|
|
|
+ imgArr: getRandomPics(Math.ceil(Math.random() * 3) + 1),
|
|
|
|
+ imgs: getRandomPics(Math.ceil(Math.random() * 3) + 1),
|
|
date: `@date('yyyy-MM-dd')`,
|
|
date: `@date('yyyy-MM-dd')`,
|
|
time: `@time('HH:mm')`,
|
|
time: `@time('HH:mm')`,
|
|
'no|100000-10000000': 100000,
|
|
'no|100000-10000000': 100000,
|