Merge branch 'hotfix/unionData' into 'release/5.4.1'
union data 容错处理 See merge request !320
Showing
1 changed file
with
10 additions
and
2 deletions
@@ -223,11 +223,19 @@ exports.orderSub = (req, res, next) => { | @@ -223,11 +223,19 @@ exports.orderSub = (req, res, next) => { | ||
223 | unionKey = testQyhUnion.client_id ? encryData : ''; | 223 | unionKey = testQyhUnion.client_id ? encryData : ''; |
224 | } | 224 | } |
225 | } else { | 225 | } else { |
226 | - unionKey = '{"client_id":' + req.cookies.mkt_code + (req.cookies.union_data ? ',"union_data":' + req.cookies.union_data : '') + '}'; | 226 | + unionKey = '{"client_id":' + req.cookies.mkt_code + |
227 | + (req.cookies.union_data ? ',"union_data":' + req.cookies.union_data : '') + '}'; | ||
227 | } | 228 | } |
228 | 229 | ||
229 | /* 检查联盟参数是否有效 */ | 230 | /* 检查联盟参数是否有效 */ |
230 | - unionInfo = unionKey ? JSON.parse(unionKey) : {}; | 231 | + try { |
232 | + unionInfo = JSON.parse(unionKey); | ||
233 | + } catch (e) { | ||
234 | + unionInfo = {}; | ||
235 | + logger.error(`orderEnsure: mkt_code:${req.cookies.mkt_code}, union_data:${req.cookies.union_data}`); | ||
236 | + } | ||
237 | + | ||
238 | + unionInfo = unionKey ? unionInfo : {}; | ||
231 | 239 | ||
232 | /* 模拟APP的User-Agent */ | 240 | /* 模拟APP的User-Agent */ |
233 | userAgent = unionInfo.client_id ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' + | 241 | userAgent = unionInfo.client_id ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' + |
-
Please register or login to post a comment