Showing
1 changed file
with
5 additions
and
2 deletions
@@ -88,13 +88,16 @@ exports.couponSend = (req, res, next) => { | @@ -88,13 +88,16 @@ exports.couponSend = (req, res, next) => { | ||
88 | // 接口要加 session 校验,跨域异步请求未添加相关参数 | 88 | // 接口要加 session 校验,跨域异步请求未添加相关参数 |
89 | if (req.yoho.isApp) { | 89 | if (req.yoho.isApp) { |
90 | if (app.app_version && app.client_type && app.session_key && app.uid) { | 90 | if (app.app_version && app.client_type && app.session_key && app.uid) { |
91 | + // 小程序调接口获取 session 的方式不同,H5 嵌小程序,client_type 标记为 h5 | ||
92 | + let isMiniApp = app.client_type === 'miniapp'; | ||
93 | + | ||
91 | uid = { | 94 | uid = { |
92 | toString: () => { | 95 | toString: () => { |
93 | return _.parseInt(app.uid); | 96 | return _.parseInt(app.uid); |
94 | }, | 97 | }, |
95 | sessionKey: app.session_key, | 98 | sessionKey: app.session_key, |
96 | - appVersion: app.app_version, | ||
97 | - appSessionType: app.client_type | 99 | + appVersion: isMiniApp ? _.get(global, 'yoho.config.appVersion') : app.app_version, |
100 | + appSessionType: isMiniApp ? 'h5' : app.client_type | ||
98 | }; | 101 | }; |
99 | } | 102 | } |
100 | } | 103 | } |
-
Please register or login to post a comment