Authored by TaoHuang

fix redis

import checkParams from '../../utils/check-params';
import apiMaps from '../../config/api-map';
import createReport from 'report-error';
const yohoApi = global.yoho.API;
const ufoAPI = global.yoho.UfoAPI;
const serviceApi = global.yoho.ServiceAPI;
const ufoAPI = global.yoho.UfoAPI;
const checkParams = require('../../utils/check-params');
const handleResult = require('../../utils/handle-result');
const apiMaps = require('../../config/api-map');
const errorHandler = require('./error-handler');
const checkApiMap = url => {
return apiMaps[url] ? apiMaps[url] : void 0;
};
const request = async({url, method, reqParams = {}, context}) => {
const apiInfo = checkApiMap(url);
const {env, user} = context;
module.exports = async(req, res, next) => {
res.set({
'Cache-Control': 'no-cache',
Pragma: 'no-cache',
Expires: (new Date(1900, 0, 1, 0, 0, 0, 0)).toUTCString()
});
const apiInfo = apiMaps[req.path];
if (!apiInfo) {
return Promise.reject(new Error(`未找到对应的接口:${url}`));
return next();
}
const baseParams = {};
req.route = {
path: req.path
};
if (!apiInfo.service) {
Object.assign(reqParams, {
uid: (user && user.uid) ? {
baseParams.method = apiInfo.api;
}
if (apiInfo.auth) {
if (req.user && req.user.uid) {
baseParams.uid = {
toString: () => {
return user.uid;
return req.user.uid;
},
sessionKey: user.sessionKey,
appSessionType: user.appSessionType
} : 1,
method: apiInfo.api,
});
}
const params = checkParams.getParams(reqParams, apiInfo);
const cache = method.toLowerCase() !== 'get' ? false : apiInfo.cache;
const headers = {
'X-YOHO-IP': env.clientIp,
'X-Forwarded-For': env.clientIp,
'User-Agent': 'yoho/nodejs'
sessionKey: req.user.sessionKey,
appSessionType: req.user.appSessionType
};
}
}
try {
const reqParams = Object.assign({}, req.query, req.body, baseParams);
const params = checkParams.getParams(reqParams, apiInfo, req);
const cache = (req.method.toLowerCase() !== 'get' || apiInfo.auth) ? false : apiInfo.cache;
let method = req.method.toLowerCase() === 'post' ? 'post' : 'get';
let result;
let apiCtx = req.ctx(global.yoho.BaseModel);
if (apiInfo.service) {
return await serviceApi.get(`${apiInfo.api}${apiInfo.path}`, params, {
result = await apiCtx.get({
api: serviceApi,
url: `${apiInfo.api || ''}${apiInfo.path || ''}`,
data: params,
param: {
cache: cache,
headers
}
});
} else if (apiInfo.ufo) {
return await ufoAPI[method](`${apiInfo.path || ''}`, params, {
cache: cache,
headers
result = await apiCtx[method]({
api: ufoAPI,
url: apiInfo.path || '',
data: params,
param: {
cache: cache
}
});
} else {
return await yohoApi[method](`${apiInfo.path || ''}`, params, {
cache: cache,
headers
});
result = await apiCtx[method]({
data: params,
url: apiInfo.path || '',
param: {
cache: cache
}
} catch (error) {
return Promise.reject({
code: error.code || 500,
message: error.message || '服务器错误'
});
}
};
const catchError = (context, reqParams) => {
return result => {
if (result && result.code === 500) {
createReport(context, 'api')(Object.assign({
api: reqParams.method,
}, result));
if (result) {
return res.json(handleResult(result, apiInfo));
}
return result;
};
};
export const createApi = context => {
return {
get(url, reqParams = {}) {
return request({url, method: 'get', reqParams, context}).then(catchError(context, reqParams));
},
post(url, reqParams = {}) {
return request({url, method: 'post', reqParams, context}).then(catchError(context, reqParams));
return res.json({
code: 400
});
} catch (error) {
return errorHandler.serverError(error, req, res, next);
}
};
};
... ...
<template>
<div class="agree">
我已阅读并同意 <span class="link">有货卖家协议</span>
<div class="agree" @click="onClick">
<i :class="getClass"></i> 我已阅读并同意 <span class="link">有货卖家协议</span>
</div>
</template>
<script>
export default {
name: 'OrderCheck'
name: 'OrderCheck',
props: {
value: {
type: Boolean,
default: true
}
},
data() {
return {
val: this.value
};
},
computed: {
getClass() {
return {
iconfont: true,
iconcheck_default: !this.val,
iconcheck_full: this.val,
icon_color: this.val
};
}
},
watch: {
value(newVal) {
this.val = newVal;
}
},
methods: {
onClick() {
this.val = !this.val;
this.$emit('input', this.val);
}
}
};
</script>
... ... @@ -18,5 +52,11 @@ export default {
.link {
color: #65ab85;
text-decoration: underline;
text-decoration-color: #65ab85;
}
.icon_color {
color: #002B47;
}
</style>
... ...
... ... @@ -7,7 +7,7 @@
<OrderMargin class="order-item order-margin"></OrderMargin>
<OrderFee class="order-item"></OrderFee>
<AddressInfo class="order-item"></AddressInfo>
<OrderAgree class="order-item"></OrderAgree>
<OrderAgree v-model="agree" class="order-item"></OrderAgree>
</div>
<ConfirmButton :txt="txt" class="footer"></ConfirmButton>
</LayoutApp>
... ... @@ -38,7 +38,8 @@ export default {
},
data() {
return {
txt: '提交'
txt: '提交',
agree: false
};
}
};
... ...
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1569294019297'); /* IE9 */
src: url('iconfont.eot?t=1569294019297#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAS4AAsAAAAACfQAAARsAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEAgqGCIUfATYCJAMkCxQABCAFhG0HaxuuCCMRJmyRR/aPBMdY62DdNnKu8kfgxUASfQRHyjPB8/850/v0vuSvAAGtgOSEPQkbwtx2F6JVgUAusmeOAmBxzhMYE2GG8hY9+kK6cfo0Pfz9oXLGpARsvsxvQYng3AMDGA5QgLI7p5esBckVuCDWRTyDXSg86MbrEKAQ1WiC9Ok3ZAwWw/qUALJk4fyZ2IID00EXrNlruNV8L/txsc4u52Vgn/t5+YFWYsHBVdZvGjGv7xx6hDb7TIMoYIrGCQ7nA4Z3gQJNAANysDGwW0OhCUqhea1hBlBC/FaF0A8rhC3Cb7INsrOzz6IotJVZlBRKUGoQHBSDe3v/eDEsiMfaUAQJK1IWQoXgQOgjKIQVEAyELRBcCL9BEMg2QPAgOxshBtlnDizi/OOlgJLAJyDdgdDF5+IIlmCQ6iJFxC9arJi1VvH58jolPJ357rvj3ntv/DvvjH377bVSN8bL8pvffXdMoWPXCuRdCS4nrk4kn2h8bsUhwXWSTJQbl64qOzYVLJHgKz8+s0muzJhkYp0yXS3qlnWYLm/0R1lXRNPpRLKMUySZDFJlizqpVF6mvBbNZOLp2Ueu5F2LX01cHnsJ105JXxU59bTxtefKn3wz8XqVizFKr9rjjxpcvleB1adLpNMi8Uz5kqkUEiSXzps/ds7cdavXRl3vmVxucU9IjUxrUtf+rfZn9L33FLVnWIZTXLjSQq82EFXN3N0tVrJYDWWoYjbTqUaWj+v9mPvtkzovDjD/e/sXRWs/CTU/1rtT55UcxelU84N84sU6n+QarKalC75S505fqX0RHX5Lr1sTu1bqWmzNmhV3St1ZsWZdgbpuXYzXlptT6huetvrpfZOfb+4LqZFpTeoq/FXns/r++4rasyzDKb666usli7bzPr3d+5vidtyoMbboJVcVld4TJ/Qmmkyc1KOXr4ypqO2K3sSRmfOGnP5pT+GfTrsn8cqaglxBQa9et+/cvsUMDVoY5HnYBED0WB9qdwB9wamPAtEnek5rWx+pyPYAwCNyFKJtWkrjf8PzUCK/YzG9eJe/bGEDwAfPXXqKsSjw2KwZLA5srPzTBWNV+fDVC/Xa6ZuZnk65UhfVaPIOMYRPX1z4+mwUEhGIKFKKTw9rKrtxDgRbUA7BIUZVUCx1MIbQBFwK0wY8LN2hEI3pf3dhSrMKRYwPNGIbgFCC58ChGA9BKcErGEP4BFzK8RN4lBCFQoyT0o8sTL11snB3ZFSCFvQfGkOjk27Z+fYbVrFXnFc7xgs5NGko0rxcvuKIfIgrwqcqRRw4pgEu8DbsewLP1KKRtBbxhyxzTV+UGhomO46MStAC+g80hkZnlsuu8v03rGKvuGPuXPyFHJr1gYKUfAPM1TBuNPdStodPVSLi+JhjGoAL+rAXBQJ8874WjaTUO+T8gYwWuU0N6elNw3u9AhRi/URfHFEx4oonMbHiSyEWCx//02bRLy19x3HZJMra7TtikBe0odit6GNIhmY0uxdamW6pmOk7mQA=') format('woff2'),
url('iconfont.woff?t=1569294019297') format('woff'),
url('iconfont.ttf?t=1569294019297') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1569294019297#iconfont') format('svg'); /* iOS 4.1- */
src: url('iconfont.eot?t=1569393439353'); /* IE9 */
src: url('iconfont.eot?t=1569393439353#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/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S8gJ1UqLFiBUnXhJJJZNcCimlkloaY+te3HgkuPHC9owZF3FaFGMKOI2jKCuafg3g6cYt05xxKvhYCyPbjWVpLidz9UHwfj6vIBD3pQCeBkXj0kx0VR6UGk8RbW9oCAAA') format('woff2'),
url('iconfont.woff?t=1569393439353') format('woff'),
url('iconfont.ttf?t=1569393439353') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1569393439353#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
... ... @@ -31,6 +31,14 @@
content: "\e618";
}
.iconleft:before {
content: "\e617";
}
.iconright:before {
content: "\e638";
}
.iconquestion1:before {
content: "\e630";
}
... ... @@ -43,6 +51,22 @@
content: "\e763";
}
.iconaddress:before {
content: "\e634";
}
.iconcheck_default:before {
content: "\e7cc";
}
.iconcheck:before {
content: "\e7cd";
}
.iconcheck_full:before {
content: "\e7ce";
}
.iconarrow:before {
content: "\e7c4";
}
... ...
... ... @@ -32,6 +32,12 @@ Created by iconfont
<glyph glyph-name="i-add" unicode="&#58904;" d="M910.509 405.585h-378.843v376.925c0 11.2-9.427 20.281-20.626 20.281s-20.626-9.080-20.626-20.281v-376.925h-376.925c-11.2 0-20.281-9.426-20.281-20.626s9.080-20.626 20.281-20.626h376.925v-378.844c0-11.199 9.427-20.281 20.626-20.281s20.626 9.081 20.626 20.281v378.844h378.843c11.199 0 20.281 9.426 20.281 20.626s-9.081 20.626-20.281 20.626z" horiz-adv-x="1024" />
<glyph glyph-name="left" unicode="&#58903;" d="M709.254038-61.195501c-15.286148 0-29.522384 5.878894-40.166815 16.564257L279.38971 345.759047c-1.425466 1.39272-2.537799 2.577708-3.449565 3.846608l-2.304486 2.905166c-11.362792 11.416004-16.945951 24.848944-16.945951 39.068807 0 14.475689 5.708002 28.010961 16.056698 38.110993l392.376529 388.216789c10.612709 10.467399 24.785499 16.236799 39.892569 16.236799 14.772448 0 28.726252-5.599532 39.287795-15.753799 10.497075-10.18599 16.538675-24.390503 16.538675-38.95215 0-14.382569-5.722328-28.009937-16.142655-38.366819L390.732587 390.901177 749.217215 31.473061c10.249435-10.30981 15.909341-23.781636 15.909341-37.994336 0-14.889105-6.05081-28.859281-16.999163-39.333844C737.70809-55.744349 723.878107-61.195501 709.254038-61.195501z" horiz-adv-x="1024" />
<glyph glyph-name="right" unicode="&#58936;" d="M312.56325 834.14421c15.286148 0 29.522384-5.878894 40.166815-16.564257l389.69649-390.391315c1.425466-1.39272 2.537799-2.577708 3.449565-3.846608l2.304486-2.905166c11.362792-11.416004 16.945951-24.848944 16.945951-39.068807 0-14.475689-5.708002-28.010961-16.056698-38.110993L356.692307-44.958702c-10.612709-10.467399-24.785499-16.236799-39.892569-16.236799-14.772448 0-28.726252 5.599532-39.287795 15.753799-10.497075 10.18599-16.538675 24.390503-16.538675 38.95215 0 14.382569 5.722328 28.009937 16.142655 38.366819l353.968777 350.170265L272.59905 741.475648c-10.249435 10.30981-15.909341 23.781636-15.909341 37.994336 0 14.889105 6.051833 28.859281 17.000186 39.333844C284.109198 828.693058 297.939181 834.14421 312.56325 834.14421z" horiz-adv-x="1024" />
<glyph glyph-name="question1" unicode="&#58928;" d="M463.99957 111.647789c0-26.509985 21.490445-48.00043 48.00043-48.00043s48.00043 21.490445 48.00043 48.00043c0 26.509985-21.490445 48.00043-48.00043 48.00043S463.99957 138.157774 463.99957 111.647789zM512-64c-247.039484 0-448 200.960516-448 448S264.960516 832 512 832 960 631.039484 960 384 759.039484-64 512-64zM512 767.712727c-211.584464 0-383.712727-172.128262-383.712727-383.712727 0-211.551781 172.128262-383.712727 383.712727-383.712727 211.551781 0 383.712727 172.159226 383.712727 383.712727C895.712727 595.584464 723.551781 767.712727 512 767.712727zM512 222.304744c-17.664722 0-32.00086 14.336138-32.00086 31.99914l0 54.112297c0 52.352533 39.999785 92.352318 75.32751 127.647359 25.887273 25.919957 52.67249 52.67249 52.67249 74.016718 0 53.343368-43.07206 96.735385-95.99914 96.735385-53.823303 0-95.99914-41.535923-95.99914-94.559333 0-17.664722-14.336138-31.99914-32.00086-31.99914s-32.00086 14.336138-32.00086 31.99914c0 87.423948 71.775299 158.559333 160.00086 158.559333s160.00086-72.095256 160.00086-160.735385c0-47.904099-36.32028-84.191695-71.424378-119.295794-27.839699-27.776052-56.575622-56.511974-56.575622-82.3356l0-54.112297C544.00086 236.671845 529.664722 222.304744 512 222.304744z" horiz-adv-x="1024" />
... ... @@ -41,6 +47,18 @@ Created by iconfont
<glyph glyph-name="back" unicode="&#59235;" d="M718.08-122.464L208 386.016 718.016 896.032l67.36-67.36-442.56-442.56 442.496-441.12-67.264-67.456z" horiz-adv-x="1024" />
<glyph glyph-name="address" unicode="&#58932;" d="M512-128S97.52381 252.586667 97.52381 481.52381a414.47619 414.47619 0 0 0 828.95238 0c0-228.937143-414.47619-609.52381-414.47619-609.52381z m0 950.857143A343.356952 343.356952 0 0 1 170.666667 477.379048C170.666667 286.72 512-30.47619 512-30.47619s341.333333 317.19619 341.333333 507.855238A343.356952 343.356952 0 0 1 512 822.857143z m0-146.285714a195.047619 195.047619 0 1 0-195.047619-195.047619 195.047619 195.047619 0 0 0 195.047619 195.047619z m0-73.142858a121.904762 121.904762 0 1 0-121.904762-121.904761 121.904762 121.904762 0 0 0 121.904762 121.904761z" horiz-adv-x="1024" />
<glyph glyph-name="check_default" unicode="&#59340;" d="M878.545455-104.727273h-733.09091A122.298182 122.298182 0 0 0 23.272727 17.454545v733.09091A122.298182 122.298182 0 0 0 145.454545 872.727273h733.09091A122.298182 122.298182 0 0 0 1000.727273 750.545455v-733.09091A122.298182 122.298182 0 0 0 878.545455-104.727273z m-733.09091 919.272728A64.116364 64.116364 0 0 1 81.454545 750.545455v-733.09091a64.116364 64.116364 0 0 1 64-64h733.09091a64.116364 64.116364 0 0 1 64 64v733.09091A64.116364 64.116364 0 0 1 878.545455 814.545455z" horiz-adv-x="1024" />
<glyph glyph-name="check" unicode="&#59341;" d="M459.985455 214.690909a28.974545 28.974545 0 0 0-20.48 8.494546L256 406.109091a29.090909 29.090909 0 0 0 40.96 41.309091l163.607273-162.909091L721.454545 544.814545a29.090909 29.090909 0 1 0 40.96-41.30909L480.465455 223.185455a28.974545 28.974545 0 0 0-20.48-8.494546zM875.636364-104.727273h-733.090909a122.298182 122.298182 0 0 0-122.181819 122.181818v733.09091A122.298182 122.298182 0 0 0 142.545455 872.727273h733.090909a122.298182 122.298182 0 0 0 122.181818-122.181818v-733.09091A122.298182 122.298182 0 0 0 875.636364-104.727273z m-733.090909 919.272728a64.116364 64.116364 0 0 1-64-64v-733.09091a64.116364 64.116364 0 0 1 64-64h733.090909a64.116364 64.116364 0 0 1 64 64v733.09091a64.116364 64.116364 0 0 1-64 64z" horiz-adv-x="1024" />
<glyph glyph-name="check_full" unicode="&#59342;" d="M878.545455 872.727273h-733.09091A122.298182 122.298182 0 0 1 23.272727 750.545455v-733.09091A122.298182 122.298182 0 0 1 145.454545-104.727273h733.09091A122.298182 122.298182 0 0 1 1000.727273 17.454545v733.09091A122.298182 122.298182 0 0 1 878.545455 872.727273z m-112.872728-369.105455l-282.181818-280.436363a29.090909 29.090909 0 0 0-40.96 0L258.327273 406.109091a29.090909 29.090909 0 0 0 40.96 41.309091l163.607272-162.909091 261.701819 260.305454a29.090909 29.090909 0 1 0 40.96-41.30909z" horiz-adv-x="1024" />
<glyph glyph-name="arrow" unicode="&#59332;" d="M1536 896L768-128 0 896z" horiz-adv-x="1536" />
... ...
export const Types = {
FETCH_ORDER_DETAIL_REQUEST: 'FETCH_ORDER_DETAIL_REQUEST',
FETCH_ORDER_DETAIL_FAIL: 'FETCH_ORDER_DETAIL_FAIL',
FETCH_ORDER_DETAIL_SUCCESS: 'FETCH_ORDER_DETAIL_SUCCESS'
};
export default function() {
return {
namespaced: true,
state: {
orderDetail: {},
fetchOrderDetail: false
},
mutations: {
[Types.FETCH_ORDER_DETAIL_REQUEST](state) {
state.fetchOrderDetail = true;
},
[Types.FETCH_ORDER_DETAIL_SUCCESS](state, data) {
state.fetchOrderDetail = false;
state.orderDetail = data;
},
[Types.FETCH_ORDER_DETAIL_FAIL](state) {
state.fetchOrderDetail = false;
}
},
actions: {
async fetchOrderDetail({ commit }, { tabType = 'sell', orderCode } = {}) {
commit(Types.FETCH_ORDER_DETAIL_REQUEST);
const result = await this.$api.post('', {
tabType,
orderCode: orderCode
});
if (result.code !== 200) {
commit(Types.FETCH_ORDER_DETAIL_FAIL);
return;
}
commit(Types.FETCH_ORDER_DETAIL_SUCCESS, result.data);
}
},
getters: {},
};
}
... ...
... ... @@ -97,10 +97,9 @@ module.exports = {
jsSdk: '//cdn.yoho.cn/js-sdk/1.3.10/jssdk.js',
redis: {
connect: {
host: '192.168.102.49',
// host: '127.0.0.1',
host: 'redis.web.yohoops.org',
port: '6379',
password: 'redis9646',
enable_offline_queue: false,
retry_strategy(options) {
if (options.error && options.error.code === 'ECONNREFUSED') {
... ... @@ -117,9 +116,9 @@ module.exports = {
}
},
session: {
host: '127.0.0.1',
host: 'redis.web.yohoops.org',
port: '6379',
pass: '',
password: 'redis9646',
prefix: 'yohobuy_session:'
}
},
... ...
... ... @@ -2,48 +2,8 @@
* param 仅为参数校验使用
*/
module.exports = {
'/api/ufo/invite/friendList': {
ufo: true,
api: 'ufo.invite.code',
params: {},
},
'/api/ufo/invite/recordDetailList': {
ufo: true,
api: 'ufo.invite.getInviteSettlementItemList',
params: {},
},
'/api/yoho/resource': {
service: true,
api: 'operations/api/v5/resource/get',
params: {
content_code: { type: String },
},
},
'/api/union/inviteList': {
api: 'app.union.shareOrder.queryInviteYohoList',
params: {
page: { type: Number },
size: { type: Number },
},
},
'/api/union/queryUnion': {
api: 'app.union.shareOrder.queryUnionTypeByUid',
params: {}
},
'/api/ufo/seller/entryGoodsSizeList': {
accessLog: true,
checkSign: false,
ufo: true,
api: 'ufo.seller.entryGoodsSizeList',
params: {
productId: {type: Number},
limit: {type: Number},
page: {type: Number}
}
},
// 订单列表查询
'/order/list': {
'/api/order/list': {
ufo: true,
api: 'ufo.order.list',
... ... @@ -58,8 +18,9 @@ module.exports = {
},
// 订单详情
'/order/detail': {
'/api/order/detail': {
ufo: true,
auth: true,
api: 'ufo.order.detail',
params: {
tabType: { type: Number, require: true }, // 订单来源
... ... @@ -69,7 +30,7 @@ module.exports = {
},
// 确认收货
'/buyer/confirm/receipt': {
'/api/buyer/confirm/receipt': {
ufo: true,
api: 'ufo.buyer.confirm',
params: {
... ...