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.
23 lines
506 B
23 lines
506 B
2 years ago
|
import { config } from '../../config/index';
|
||
|
|
||
|
/** 获取评价商品 */
|
||
|
function mockGetGoods(parameter) {
|
||
|
const { delay } = require('../_utils/delay');
|
||
|
const { getGoods } = require('../../model/submitComment');
|
||
|
const data = getGoods(parameter);
|
||
|
|
||
|
return delay().then(() => {
|
||
|
return data;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/** 获取评价商品 */
|
||
|
export function getGoods(parameter) {
|
||
|
if (config.useMock) {
|
||
|
return mockGetGoods(parameter);
|
||
|
}
|
||
|
return new Promise((resolve) => {
|
||
|
resolve('real api');
|
||
|
});
|
||
|
}
|