1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import { randomSelectOne, randomSelectN } from './utils';
- const lodash = require('lodash');
- const Mock = require('mockjs');
- const Random = Mock.Random;
- let imageDatabase = []; //图片资源库
- let videoDatabase = []; //视频资源库
- const baseImageData = [{
- id: 1,
- code: 'J-02-01-612101',
- name: '破解表情密码01',
- size: 90,
- status: 'NORMAL',
- gmtCreated: Random.datetime('yyyy-MM-dd'),
- gmtModified: Random.datetime('yyyy-MM-dd'),
- url: 'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/01/612102.jpg',
- },{
- id: 2,
- code: 'J-02-01-612102',
- name: '破解表情秘码02',
- size: 90,
- status: 'NORMAL',
- gmtCreated: Random.datetime('yyyy-MM-dd'),
- gmtModified: Random.datetime('yyyy-MM-dd'),
- url: 'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/01/612101.jpg',
- },{
- id: 3,
- code: 'J-02-01-611901',
- name: '看得见的旗语01',
- size: 90,
- status: 'NORMAL',
- gmtCreated: Random.datetime('yyyy-MM-dd'),
- gmtModified: Random.datetime('yyyy-MM-dd'),
- url: 'http://efunimgs.oss-cn-beijing.aliyuncs.com/resources/J/02/01/611901.jpg',
- }];
- const baseVideoData = [{
- id: 1,
- code: 'J-03-02-600149',
- name: '自制保险箱',
- size: 90,
- status: 'NORAML',
- gmtCreated: Random.datetime('yyyy-MM-dd'),
- gmtModified: Random.datetime('yyyy-MM-dd'),
- url: 'http://efunvideo.ai160.com/vs2m/015/01503009/01503009031/01503009031.m3u8',
- }];
- for (let i = 1; i < 200; i++) {
- let imageItem = randomSelectOne(baseImageData);
- let videoItem = randomSelectOne(baseVideoData);
- let imgTmp = lodash.cloneDeep(imageItem);
- let videoTmp = lodash.cloneDeep(videoItem);
- imgTmp.key = i;
- videoTmp.key = i;
- imageDatabase.push(imgTmp);
- videoDatabase.push(videoTmp);
- }
- module.exports = {
- imageDatabase,
- videoDatabase,
- }
|