Blame view

mock/table.js 580 Bytes
80a28914e   吉鹏   init
1
2
3
  import Mock from 'mockjs'
  
  const data = Mock.mock({
c44ba96f6   Adam   auto commit the c...
4
    'items|10': [{
80a28914e   吉鹏   init
5
      id: '@id',
1172ebb79   Adam   auto commit the c...
6
      title: '@sentence(10, 10)',
80a28914e   吉鹏   init
7
      'status|1': ['published', 'draft', 'deleted'],
1172ebb79   Adam   auto commit the c...
8
9
10
11
12
      username: '@sentence(1, 2)',
      create_at: '@datetime',
      pageviews: '@integer(10, 500)',
      openid: '@sentence(1, 1)',
      avatar:'----'
80a28914e   吉鹏   init
13
14
15
16
17
    }]
  })
  
  export default [
    {
c44ba96f6   Adam   auto commit the c...
18
      url: '/yp/table/list',
80a28914e   吉鹏   init
19
20
21
22
23
24
25
26
27
28
29
30
31
      type: 'get',
      response: config => {
        const items = data.items
        return {
          code: 20000,
          data: {
            total: items.length,
            items: items
          }
        }
      }
    }
  ]