You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git/scr/miniprogram-2/services/comments/fetchComments.js

19 lines
486 B

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');
});
}