Authored by 毕凯

Merge branch 'hotfix/paydetail' into 'release/6.5.2'

cliet-type



See merge request !1292
... ... @@ -102,7 +102,9 @@ app.use((req, res, next) => {
req.app.locals.wap = app.locals.wap; // zookeper对象赋值
// 判断请求是否来自app
req.yoho.isMiniApp = /miniProgram/i.test(req.get('User-Agent') || '');
req.yoho.isMiniApp = /miniProgram/i.test(req.get('User-Agent') || '') ||
req.query.client_type === 'miniapp' ||
req.cookies.app_client_type === 'miniapp';
req.yoho.isNowApp = /yohonow/i.test(req.get('User-Agent') || '');
req.yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || '');
req.yoho.isYohoApp = /YohoBuy/i.test(req.get('User-Agent') || '');
... ...
... ... @@ -77,7 +77,7 @@ exports.couponSend = (req, res, next) => {
};
// 接口要加 session 校验,跨域异步请求未添加相关参数
if (req.yoho.isApp) {
if (req.yoho.isApp || app.client_type === 'miniapp') {
if (app.app_version && app.client_type && app.session_key && app.uid) {
// 小程序调接口获取 session 的方式不同,H5 嵌小程序,client_type 标记为 h5
let isMiniApp = app.client_type === 'miniapp';
... ...