Authored by htoooth

Merge branch 'feature/ufo' of http://git.yoho.cn/fe/yoho-app-web into feature/ufo

... ... @@ -36,19 +36,19 @@ const request = async({url, method, reqParams, context}) => {
};
if (apiInfo.service) {
return await serviceApi.get(apiInfo.api, params, {
return await serviceApi.get(`${apiInfo.api}${apiInfo.path}`, params, {
cache: cache,
code: 200,
headers
});
} else if (apiInfo.ufo) {
return await ufoAPI[method]('', params, {
return await ufoAPI[method](`${apiInfo.path}`, params, {
cache: cache,
code: 200,
headers
});
} else {
return await yohoApi[method]('', params, {
return await yohoApi[method](`${apiInfo.path}`, params, {
code: 200,
cache: cache,
headers
... ...
... ... @@ -104,7 +104,8 @@ export default {
}
],
scrollOptions: {
directionLockThreshold: 0
directionLockThreshold: 0,
stopPropagation: true
},
slideOptions: {
listenScroll: true,
... ...
... ... @@ -21,4 +21,13 @@ export default {
[Types.POST_NOSALE_SUCCESS](state) {
state.fetchingNoSale = false;
},
[Types.POST_CHANGEPRICE_REQUEST](state) {
state.fetchingNoSale = true;
},
[Types.POST_CHANGEPRICE_FAILD](state) {
state.fetchingNoSale = false;
},
[Types.POST_NOSALE_SUCCESS](state) {
state.fetchingNoSale = false;
},
};
... ...
... ... @@ -18,7 +18,7 @@ export default function() {
pageVisible: false,
touchStatus: '',
scrollTime: 0,
direction: 'forword'
direction: 'forword',
},
mutations: {
[Types.SET_ENV]() {
... ...
export default err => {
}
\ No newline at end of file
... ...
... ... @@ -48,6 +48,7 @@ module.exports = async(req, res, next) => {
} else if (apiInfo.ufo) {
result = await apiCtx[method]({
api: ufoAPI,
url: apiInfo.path,
data: params,
param: {
code: 200,
... ... @@ -57,6 +58,7 @@ module.exports = async(req, res, next) => {
} else {
result = await apiCtx[method]({
data: params,
url: apiInfo.path,
param: {
code: 200,
cache: cache
... ...
... ... @@ -56,12 +56,11 @@ const handlerError = (err = {}, req, res, next) => {
} else if (err.code === 500) {
return res.redirect('/error/500');
}
console.log(err)
return next(err);
};
const getCacheKey = (urlPath, cackeKey = '') => {
const urlObj = url.parse(urlPath);
const urlObj = url.parse(urlPath);
return md5(cackeKey
.replace('$url', urlObj.pathname)
... ...