Authored by weiqingting

添加 app_version 到 User-Agent

... ... @@ -144,6 +144,7 @@ exports.index = (req, res, next) => {
let code = 'a83b7d55324fb65f96c1f85a3387ebd8';
let uid = req.__USER__.uid;
let options;
let noLoginUrl = helpers.urlFormat('/activity/student/register')+'?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '://m.yohobuy.com/activity/student"}}}';
... ... @@ -183,23 +184,14 @@ exports.index = (req, res, next) => {
if (coupons && coupons.data) {
coupons.link = link && link.data ? link.data[0].url + (req.__USER__.isApp ? '&app_version=' + req.__USER__.app_version : '') : '';
coupons.data = (coupons.data || []).map((item) => {
// let url = item.image.url;
couponids.push(item.couponID);
if (!req.__USER__.isLogin) {
item.image.url = 'http://m.yohobuy.com/activity/student/register?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http://m.yohobuy.com/activity/student"}}}';
}
// if (item.image.url.indexOf('?') === -1) {
// item.image.url += '?';
// if (!req.__USER__.isLogin) {
// url = 'http://m.yohobuy.com/activity/student/register?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http://m.yohobuy.com/activity/student"}}}';
// }
//
//
// url = item.image.url.substring(0, item.image.url.indexOf('?'));
//
// param = JSON.stringify(getRequest(item.image.url));
// item.image.url = item.image.url + '&app_version=1&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + url + '","param":' + param + '}}';
// console.log(item);
// item.image.noLoginUrl=url;
return item;
});
}
... ... @@ -240,7 +232,8 @@ exports.index = (req, res, next) => {
http: req.__USER__.http,
uid: req.__USER__.uid,
app_version: req.__USER__.app_version,
isAppNoLogin: req.__USER__.isApp && !req.__USER__.isLogin
isAppNoLogin: req.__USER__.isApp && !req.__USER__.isLogin,
noLoginUrl:noLoginUrl
};
if (!req.__USER__.isApp) {
options.pageHeader = headerModel.setNav({
... ... @@ -259,7 +252,7 @@ exports.index = (req, res, next) => {
}
} else {
// no login
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}}';
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
}
} else {
if (options.isLogin) {
... ...
... ... @@ -40,7 +40,7 @@
<a href='{{image.url}}' class="main-left"></a>
{{#isEqual status 1}}
{{#if @root.isAppNoLogin}}
<a href='{{../image.url}}' class="main-right-use" >
<a href='{{@root.noLoginUrl}}' class="main-right-use" >
<span class="on-receive on-lingqu no-bg">
<p>点击</p>
<p>领取</p>
... ... @@ -126,7 +126,7 @@
<a href="{{url}}">{{product_name}}</a>
</div>
<div class="price">
<span class="sale-price">¥{{round student_price}} <i class='s-biaoqian'>学生价</i></span>
<span class="sale-price">¥{{round student_price}} <a class='s-biaoqian'>学生价</a></span>
<p class="s-price-block">
<span class="market-price">¥{{round market_price}}</span>
</p>
... ...
'use strict';
const fs = require('fs');
let devHost = 'localhost';
let devHost = '172.16.6.159';
fs.readFile('.devhost', (err, buf)=> {
if (!err) {
... ...