Merge branch 'master' into release/6.5.2
Showing
6 changed files
with
26 additions
and
22 deletions
@@ -14,12 +14,12 @@ exports.index = (req, res) => { | @@ -14,12 +14,12 @@ exports.index = (req, res) => { | ||
14 | req.yoho.captchaShow = false; | 14 | req.yoho.captchaShow = false; |
15 | res.locals.useGeetest = true; | 15 | res.locals.useGeetest = true; |
16 | 16 | ||
17 | - if (_.has(res, 'locals.loadJs')) { | ||
18 | - res.locals.loadJs.push({ | 17 | + if (_.has(res, 'locals.loadJsBefore')) { |
18 | + res.locals.loadJsBefore.push({ | ||
19 | src: global.yoho.config.geetestJs | 19 | src: global.yoho.config.geetestJs |
20 | }); | 20 | }); |
21 | } else { | 21 | } else { |
22 | - res.locals.loadJs = [ | 22 | + res.locals.loadJsBefore = [ |
23 | { | 23 | { |
24 | src: global.yoho.config.geetestJs | 24 | src: global.yoho.config.geetestJs |
25 | } | 25 | } |
@@ -76,15 +76,6 @@ exports.couponSend = (req, res, next) => { | @@ -76,15 +76,6 @@ exports.couponSend = (req, res, next) => { | ||
76 | data: '' | 76 | data: '' |
77 | }; | 77 | }; |
78 | 78 | ||
79 | - // APP时用参数中的ID | ||
80 | - if (!uid) { | ||
81 | - uid = app && app.uid ? app.uid : 0; | ||
82 | - } | ||
83 | - | ||
84 | - if (uid === '' || uid === 0 || token === '' || token === 0) { | ||
85 | - return res.jsonp(resultData); | ||
86 | - } | ||
87 | - | ||
88 | // 接口要加 session 校验,跨域异步请求未添加相关参数 | 79 | // 接口要加 session 校验,跨域异步请求未添加相关参数 |
89 | if (req.yoho.isApp) { | 80 | if (req.yoho.isApp) { |
90 | 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) { |
@@ -102,6 +93,10 @@ exports.couponSend = (req, res, next) => { | @@ -102,6 +93,10 @@ exports.couponSend = (req, res, next) => { | ||
102 | } | 93 | } |
103 | } | 94 | } |
104 | 95 | ||
96 | + if (uid === '' || uid === 0 || token === '' || token === 0) { | ||
97 | + return res.jsonp(resultData); | ||
98 | + } | ||
99 | + | ||
105 | model.couponSend(uid, token).then(result => { | 100 | model.couponSend(uid, token).then(result => { |
106 | res.set({ | 101 | res.set({ |
107 | 'Cache-Control': 'no-cache', | 102 | 'Cache-Control': 'no-cache', |
@@ -26,12 +26,12 @@ const load = (req, res, next) => { | @@ -26,12 +26,12 @@ const load = (req, res, next) => { | ||
26 | 26 | ||
27 | res.locals.useGeetest = !req.yoho.captchaShow; | 27 | res.locals.useGeetest = !req.yoho.captchaShow; |
28 | 28 | ||
29 | - if (_.has(res, 'locals.loadJs')) { | ||
30 | - res.locals.loadJs.push({ | 29 | + if (_.has(res, 'locals.loadJsBefore')) { |
30 | + res.locals.loadJsBefore.push({ | ||
31 | src: global.yoho.config.geetestJs | 31 | src: global.yoho.config.geetestJs |
32 | }); | 32 | }); |
33 | } else { | 33 | } else { |
34 | - res.locals.loadJs = [ | 34 | + res.locals.loadJsBefore = [ |
35 | { | 35 | { |
36 | src: global.yoho.config.geetestJs | 36 | src: global.yoho.config.geetestJs |
37 | } | 37 | } |
@@ -13,9 +13,10 @@ const isTest = process.env.NODE_ENV === 'test'; | @@ -13,9 +13,10 @@ const isTest = process.env.NODE_ENV === 'test'; | ||
13 | 13 | ||
14 | const domains = { | 14 | const domains = { |
15 | 15 | ||
16 | - // api: 'http://api.yoho.cn/', | ||
17 | - // service: 'http://service.yoho.cn/', | ||
18 | - // liveApi: 'http://testapi.live.yohops.com:9999/', | 16 | + api: 'http://api.yoho.cn/', |
17 | + service: 'http://service.yoho.cn/', | ||
18 | + liveApi: 'http://testapi.live.yohops.com:9999/', | ||
19 | + singleApi: 'http://api-test3.yohops.com:9999/', | ||
19 | 20 | ||
20 | // gray | 21 | // gray |
21 | // api: 'http://apigray.yoho.cn/', | 22 | // api: 'http://apigray.yoho.cn/', |
@@ -23,9 +24,11 @@ const domains = { | @@ -23,9 +24,11 @@ const domains = { | ||
23 | // platformApi: 'http://172.16.6.210:8088/', | 24 | // platformApi: 'http://172.16.6.210:8088/', |
24 | 25 | ||
25 | 26 | ||
26 | - api: 'http://api-test3.yohops.com:9999/', | ||
27 | - service: 'http://service-test3.yohops.com:9999/', | ||
28 | - liveApi: 'http://testapi.live.yohops.com:9999/', | 27 | + // api: 'http://api-test3.yohops.com:9999/', |
28 | + // service: 'http://service-test3.yohops.com:9999/', | ||
29 | + // liveApi: 'http://testapi.live.yohops.com:9999/', | ||
30 | + // singleApi: 'http://api-test3.yohops.com:9999/', | ||
31 | + | ||
29 | imSocket: 'ws://socket.yohobuy.com:10240', | 32 | imSocket: 'ws://socket.yohobuy.com:10240', |
30 | imCs: 'http://im.yohobuy.com/api', | 33 | imCs: 'http://im.yohobuy.com/api', |
31 | global: 'http://api-global.yohobuy.com', | 34 | global: 'http://api-global.yohobuy.com', |
@@ -132,6 +132,9 @@ | @@ -132,6 +132,9 @@ | ||
132 | var STATIC_RESOURCE_HASH = '{{startTime}}'; | 132 | var STATIC_RESOURCE_HASH = '{{startTime}}'; |
133 | var STATIC_RESOURCE_PATH = '//{{devHost}}:{{port}}'; | 133 | var STATIC_RESOURCE_PATH = '//{{devHost}}:{{port}}'; |
134 | window.jsFiles = [ | 134 | window.jsFiles = [ |
135 | + {{#loadJsBefore}} | ||
136 | + '{{src}}', | ||
137 | + {{/loadJsBefore}} | ||
135 | '//{{devHost}}:{{port}}/libs.js?t={{startTime}}', | 138 | '//{{devHost}}:{{port}}/libs.js?t={{startTime}}', |
136 | '//{{devHost}}:{{port}}/{{module}}.{{page}}.js?t={{startTime}}' | 139 | '//{{devHost}}:{{port}}/{{module}}.{{page}}.js?t={{startTime}}' |
137 | {{#loadJs}} | 140 | {{#loadJs}} |
@@ -144,6 +147,9 @@ | @@ -144,6 +147,9 @@ | ||
144 | var STATIC_RESOURCE_HASH = '{{startTime}}'; | 147 | var STATIC_RESOURCE_HASH = '{{startTime}}'; |
145 | var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/yohobuywap-node/{{version}}'; | 148 | var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/yohobuywap-node/{{version}}'; |
146 | window.jsFiles = [ | 149 | window.jsFiles = [ |
150 | + {{#loadJsBefore}} | ||
151 | + '{{src}}', | ||
152 | + {{/loadJsBefore}} | ||
147 | '//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}', | 153 | '//cdn.yoho.cn/yohobuywap-node/{{version}}/libs.js?t={{startTime}}', |
148 | '//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}' | 154 | '//cdn.yoho.cn/yohobuywap-node/{{version}}/{{module}}.{{page}}.js?t={{startTime}}' |
149 | {{#loadJs}} | 155 | {{#loadJs}} |
-
Please register or login to post a comment