litian
2024-03-15 3f1ea0a8e4bb02bf7544df8660b15cfa69d6b84a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { config } from '../../config/index';
 
/** 获取商品评论 */
function mockFetchComments(parmas) {
  const { delay } = require('../_utils/delay');
  const { getGoodsAllComments } = require('../../model/comments');
  return delay().then(() => getGoodsAllComments(parmas));
}
 
/** 获取商品评论 */
export function fetchComments(parmas) {
  if (config.useMock) {
    return mockFetchComments(parmas);
  }
  return new Promise((resolve) => {
    resolve('real api');
  });
}