degrade.js
1.51 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
'use strict';
import Model from './model';
import _ from 'lodash';
const defaultDegrades = [
{
path: '/pc/common/myYohoHover',
name: '【公共头部】MY有货鼠标移入显示账户信息'
},
{
path: '/pc/common/cartCountShow',
name: '【公共头部】购物车图标显示购物车商品数目'
},
{
path: '/pc/common/cartHover',
name: '【公共头部】购物车图标鼠标移入请求、显示购物车商品列表'
},
{
path: '/pc/brandInfoTipSHow',
name: '【品牌一览】品牌名移入显示品牌简介Tip'
},
{
path: '/pc/recentViewShow',
name: '【商品列表/商品详情】显示最近浏览'
},
{
path: '/pc/guang/hotTagShow',
name: '【逛】显示热门标签'
},
{
path: '/pc/guang/adShow',
name: '【逛】显示广告banner'
},
{
path: '/pc/guang/itemCommentShow',
name: '【逛】详情页显示评论'
},
{
path: '/wap/plustar/collect',
name: '【Plustar】品牌收藏'
}
];
class Degrade extends Model {
constructor() {
super('degrade');
}
async init() {
for (let i of defaultDegrades) {
let count = await this.count({
path: i.path
});
if (count === 0) {
await this.insert(i);
}
}
}
}
export default Degrade;