Authored by zhangxiaoru

判断 protocol取不到

@@ -8,7 +8,7 @@ exports.index = (req, res, next) => { @@ -8,7 +8,7 @@ exports.index = (req, res, next) => {
8 let activityId = req.query.act_id || 2023, 8 let activityId = req.query.act_id || 2023,
9 isApp = req.yoho.isApp, 9 isApp = req.yoho.isApp,
10 uid = req.user.uid, 10 uid = req.user.uid,
11 - protocol = req.protocol; 11 + protocol = req.protocol ? req.protocol + ':' : '';
12 12
13 co(function* () { 13 co(function* () {
14 let isStudent = yield req.ctx(shareBuyModel).checkStudent(uid); 14 let isStudent = yield req.ctx(shareBuyModel).checkStudent(uid);
@@ -44,8 +44,8 @@ module.exports = class extends global.yoho.BaseModel { @@ -44,8 +44,8 @@ module.exports = class extends global.yoho.BaseModel {
44 }); 44 });
45 45
46 if (isApp) { 46 if (isApp) {
47 - val.detailUrl = protocol + ':' + val.detailUrl +  
48 - '&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + protocol + ':' + 47 + val.detailUrl = protocol + val.detailUrl +
  48 + '&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + protocol +
49 val.detailUrl + '","params":{"couponId":"' + val.couponId + '","couponCode":"' + 49 val.detailUrl + '","params":{"couponId":"' + val.couponId + '","couponCode":"' +
50 val.couponCode + '"}}}'; 50 val.couponCode + '"}}}';
51 } 51 }