litian
2024-02-28 50aaa9d0da14c1568107f29813c7fe5858b033b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { config } from '../../config/index';
 
/** 获取商品列表 */
function mockFetchGoodCategory() {
  const { delay } = require('../_utils/delay');
  const { getCategoryList } = require('../../model/category');
  return delay().then(() => getCategoryList());
}
 
/** 获取商品列表 */
export function getCategoryList() {
  if (config.useMock) {
    return mockFetchGoodCategory();
  }
  return new Promise((resolve) => {
    resolve('real api');
  });
}