Merge branch 'hotfix/paydetail' into 'release/6.5.2'
cliet-type See merge request !1292
Showing
2 changed files
with
4 additions
and
2 deletions
@@ -102,7 +102,9 @@ app.use((req, res, next) => { | @@ -102,7 +102,9 @@ app.use((req, res, next) => { | ||
102 | req.app.locals.wap = app.locals.wap; // zookeper对象赋值 | 102 | req.app.locals.wap = app.locals.wap; // zookeper对象赋值 |
103 | 103 | ||
104 | // 判断请求是否来自app | 104 | // 判断请求是否来自app |
105 | - req.yoho.isMiniApp = /miniProgram/i.test(req.get('User-Agent') || ''); | 105 | + req.yoho.isMiniApp = /miniProgram/i.test(req.get('User-Agent') || '') || |
106 | + req.query.client_type === 'miniapp' || | ||
107 | + req.cookies.app_client_type === 'miniapp'; | ||
106 | req.yoho.isNowApp = /yohonow/i.test(req.get('User-Agent') || ''); | 108 | req.yoho.isNowApp = /yohonow/i.test(req.get('User-Agent') || ''); |
107 | req.yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || ''); | 109 | req.yoho.isMarsApp = /yohomars/i.test(req.get('User-Agent') || ''); |
108 | req.yoho.isYohoApp = /YohoBuy/i.test(req.get('User-Agent') || ''); | 110 | req.yoho.isYohoApp = /YohoBuy/i.test(req.get('User-Agent') || ''); |
@@ -77,7 +77,7 @@ exports.couponSend = (req, res, next) => { | @@ -77,7 +77,7 @@ exports.couponSend = (req, res, next) => { | ||
77 | }; | 77 | }; |
78 | 78 | ||
79 | // 接口要加 session 校验,跨域异步请求未添加相关参数 | 79 | // 接口要加 session 校验,跨域异步请求未添加相关参数 |
80 | - if (req.yoho.isApp) { | 80 | + if (req.yoho.isApp || app.client_type === 'miniapp') { |
81 | if (app.app_version && app.client_type && app.session_key && app.uid) { | 81 | if (app.app_version && app.client_type && app.session_key && app.uid) { |
82 | // 小程序调接口获取 session 的方式不同,H5 嵌小程序,client_type 标记为 h5 | 82 | // 小程序调接口获取 session 的方式不同,H5 嵌小程序,client_type 标记为 h5 |
83 | let isMiniApp = app.client_type === 'miniapp'; | 83 | let isMiniApp = app.client_type === 'miniapp'; |
-
Please register or login to post a comment