...
|
...
|
@@ -34,6 +34,7 @@ const request = async({url, method, reqParams = {}, context}) => { |
|
|
'User-Agent': 'yoho/nodejs'
|
|
|
};
|
|
|
|
|
|
try {
|
|
|
if (apiInfo.service) {
|
|
|
return await serviceApi.get(`${apiInfo.api}${apiInfo.path}`, params, {
|
|
|
cache: cache,
|
...
|
...
|
@@ -53,6 +54,12 @@ const request = async({url, method, reqParams = {}, context}) => { |
|
|
headers
|
|
|
});
|
|
|
}
|
|
|
} catch (error) {
|
|
|
return Promise.reject({
|
|
|
code: error.code || 500,
|
|
|
message: error.message || '服务器错误'
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
export const createApi = context => {
|
...
|
...
|
|