fe-drone-ci/src/mock/article.js

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2017-04-23 11:50:32 +00:00
import Mock from 'mockjs';
const List = [];
const count = 20;
for (let i = 0; i < count; i++) {
List.push(Mock.mock({
id: '@id',
title: '@ctitle(10, 20)',
'status|1': ['published', 'draft'],
author: '@cname',
display_time: '@datetime',
pageviews: '@integer(300, 5000)'
}));
}
export default {
getList: () => new Promise(resolve => {
setTimeout(() => {
resolve([200, {
data: List
}]);
}, 100);
}),
getArticle: () => new Promise(resolve => {
setTimeout(() => {
resolve([200, {
data: {
id: 120000000001,
author: { key: 'mockPan' },
source_name: '原创作者',
category_item: [{ key: 'global', name: '全球' }],
comment_disabled: false,
content: '<p>我是测试数据我是测试数据</p><p><img class="wscnph" src="https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943" data-wscntype="image" data-wscnh="300" data-wscnw="400" data-mce-src="https://wpimg.wallstcn.com/4c69009c-0fd4-4153-b112-6cb53d1cf943"></p>"',
content_short: '我是测试数据',
display_time: +new Date(),
image_uri: 'https://wpimg.wallstcn.com/e4558086-631c-425c-9430-56ffb46e70b3',
platforms: ['a-platform'],
source_uri: 'https://github.com/PanJiaChen/vue-element-admin',
status: 'published',
tags: [],
title: ''
}
}]);
}, 100);
})
};