Authored by 梁志锋

去掉https

Showing 29 changed files with 73 additions and 101 deletions
... ... @@ -24,16 +24,16 @@ class Helpers
switch ($module) {
case 'default':
$url = '//m.yohobuy.com';
$url = 'http://m.yohobuy.com';
break;
case 'guang': // 逛
$url = '//guang' . SUB_DOMAIN;
$url = 'http://guang' . SUB_DOMAIN;
break;
case 'list': // 商品列表
$url = '//list' . SUB_DOMAIN;
$url = 'http://list' . SUB_DOMAIN;
break;
case 'search': // 搜索
$url = '//search' . SUB_DOMAIN;
$url = 'http://search' . SUB_DOMAIN;
break;
case 'index': // 默认
$url = SITE_MAIN;
... ... @@ -41,7 +41,7 @@ class Helpers
case '': // 相对地址
break;
default: // 其它子域名
$url = '//' . $module . SUB_DOMAIN;
$url = 'http://' . $module . SUB_DOMAIN;
}
$url .= $uri;
if (!empty($param)) {
... ... @@ -62,7 +62,7 @@ class Helpers
*/
public static function getImageUrl($url, $width, $height, $mode = 2)
{
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode));
}
/**
... ... @@ -87,10 +87,6 @@ class Helpers
public static function getFilterUrl($url)
{
$url = strtr($url, array('.m.yohobuy.com' => SUB_DOMAIN, OLD_MAIN => SITE_MAIN, 'www.yohobuy.com' => SITE_MAIN));
if (strrpos($url, 'm.yohobuy.com') && !strrpos($url, 'sale.m.yohobuy.com') && !strrpos($url, 'cuxiao.m.yohobuy.com')
&& !strrpos($url, 'activity.m.yohobuy.com') && !strrpos($url, 'huodong.m.yohobuy.com') && strrpos($url, 'cdn.yoho.cn/myohobuy') && !strrpos($url, '/home/orders/pay')) {
$url = strtr($url, array('http://' => '//'));
}
$filter = strstr($url, 'openby:yohobuy=', true);
if ($filter) {
return rtrim(rtrim($filter, '?'), '&');
... ... @@ -264,11 +260,9 @@ class Helpers
$result['salePrice'] && $result['salePrice'] .= '.00';
}
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$url = self::url('/product/pro_' . $productData['product_id'] . '_'
$result['url'] = self::url('/product/pro_' . $productData['product_id'] . '_'
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html');
$result['url'] = strtr($url, array('http://' => '//'));
// APP访问需要加附加的参数
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
if ($isApp) {
... ... @@ -373,9 +367,6 @@ class Helpers
$articleData['author']['url'] = Helpers::getFilterUrl($articleData['author']['url']);
}
$result['author'] = $articleData['author'];
if (isset($result['author']['avatar'])) {
$result['author']['avatar'] = strtr($result['author']['avatar'], array('http://' => '//'));
}
}
// 模板中需要的标签标识
... ...
... ... @@ -51,7 +51,7 @@ class Images
return $fileName;
}
$domain = self::getDomain($bucket, $fileName);
return '//' . $domain . '/' . $bucket . $fileName;
return 'http://' . $domain . '/' . $bucket . $fileName;
}
/**
... ... @@ -71,7 +71,7 @@ class Images
if (stripos($fileName, 'http://') !== 0) {
$fileName = self::template($fileName, $bucket, $mode);
}
return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode));
}
/**
... ...
... ... @@ -152,17 +152,17 @@ function reMarginFooter(fixedElement) {
//未登录
$op.prepend(
'<a href="//m.yohobuy.com/signin.html?refer=' + location.href + '">登录</a>' +
'<a href="http://m.yohobuy.com/signin.html?refer=' + location.href + '">登录</a>' +
'<span class="sep-line">|</span>' +
'<a href="//m.yohobuy.com/reg.html">注册</a>'
'<a href="http://m.yohobuy.com/reg.html">注册</a>'
);
} else {
//已登录
$op.prepend(
'<span>Hi,</span>' +
'<a class="user-name" href="//m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="//m.yohobuy.com/passport/signout/index?token=' + user[3] + '">退出</a>'
'<a class="user-name" href="http://m.yohobuy.com/home?tmp=' + Math.random() + '">' + user[0] + '</a>' +
'<a href="http://m.yohobuy.com/passport/signout/index">退出</a>'
);
}
... ... @@ -191,7 +191,7 @@ function reMarginFooter(fixedElement) {
a.async = 1;
a.src = j;
m.parentNode.insertBefore(a, m);
})(window, document, 'script', ('https:' == document.location.protocol ? 'https' : 'http') + '://' + 'cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
})(window, document, 'script', 'http://cdn.yoho.cn/yas-jssdk/1.0.14/yas.js', '_yas');
(function() {
var uid = getUid();
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="back-email-success-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -8,4 +8,4 @@
<a id="resend" class="resend" data-url={{resendUrl}}>重新发送邮件</a>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="back-email-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -8,4 +8,4 @@
<span id="btn-sure" class="btn btn-sure disable row">确定</span>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="back-code-page passport-page yoho-page">
{{> passport/code}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="back-mobile-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -10,4 +10,4 @@
<span id="btn-next" class="btn btn-next disable row">下一步</span>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="back-new-password-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -17,4 +17,4 @@
<input id="email-code" type="hidden" value={{.}}>
{{/ code}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="reg-code-page passport-page yoho-page">
<input type="hidden" id="isReg" value="{{isReg}}">
<input type="hidden" id="openId" value="{{openId}}">
... ... @@ -6,4 +6,4 @@
<input type="hidden" id="nickname" value="{{nickname}}">
{{> passport/code}}
</div>
{{> layout/footer}}
{{> layout/footer_passport}}
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="bind-page passport-page yoho-page">
<input type="hidden" id="openId" value="{{openId}}">
<input type="hidden" id="sourceType" value="{{sourceType}}">
... ... @@ -14,4 +14,4 @@
<p class="bind-tip">绑定手机号码后,可选择{{platform}}和手机号登录此帐号</p>
</div>
</div>
{{> layout/footer}}
{{> layout/footer_passport}}
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="bind-password-page passport-page yoho-page">
<input type="hidden" id="openId" value="{{openId}}">
<input type="hidden" id="sourceType" value="{{sourceType}}">
... ... @@ -15,4 +15,4 @@
<input id="token" type="hidden" value={{token}}>
<input id="code" type="hidden" value={{code}}>
</div>
{{> layout/footer}}
{{> layout/footer_passport}}
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="login-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -41,4 +41,4 @@
</ul>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="login-international-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -13,4 +13,4 @@
<span id="btn-login" class="btn btn-login disble row">登录</span>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="reg-code-page passport-page yoho-page">
{{> passport/code}}
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="reg-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -11,4 +11,4 @@
<p class="register-tip">YOHO!Family账号可登录Yoho!Buy有货、YOHO!Boys、YOHO!Girls及SHOW</p>
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
{{> layout/header}}
{{> layout/header_passport}}
<div class="reg-password-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -20,4 +20,4 @@ var r=b.getElementsByTagName('script')[0];r.parentNode.insertBefore(s,r);
_agtjs('init','AG_052186_PHCW','yohobuy.com');
_agtjs('loadEvent',{atsev:101,'atsrmv':""});
</script>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer_passport}}
\ No newline at end of file
... ...
... ... @@ -11,7 +11,7 @@
(function() {
var hm = document.createElement("script");
hm.src = "//static.yohobuy.com/js/analytics/analysis.js";
hm.src = "http://static.yohobuy.com/js/analytics/analysis.js";
hm.async = 1;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
... ...
{{> layout/page_footer}}
{{> layout/download_app}}
{{#if hasWxShare}}
<script type="text/javascript" charset="utf-8" src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" charset="utf-8" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
{{/if}}
{{#if rlsEnv}}
<script src="//cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
<script src="//cdn.yoho.cn/myohobuy/{{version}}/index.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script>
{{/if}}
{{#if preEnv}}
<script src="//cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
<script src="//cdn.yoho.cn/myohobuy/{{version}}/index.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index.js"></script>
{{/if}}
{{#if testEnv}}
<script src="//cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
<script src="//cdn.yoho.cn/myohobuy/{{version}}/index-debug.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"></script>
<script src="http://cdn.yoho.cn/myohobuy/{{version}}/index-debug.js"></script>
{{/if}}
{{#if devEnv}}
<script src="//localhost:8000/static/js/sea.js?nowrap"></script>
<script>seajs.config({base: '//localhost:8000/'});</script>
<script src="http://localhost:8000/static/js/sea.js?nowrap"></script>
<script>seajs.config({base: 'http://localhost:8000/'});</script>
{{/if}}
{{> layout/use}}
{{> layout/analysis}}
... ...
... ... @@ -27,20 +27,20 @@
<link rel="dns-prefetch" href="//img12.static.yhbimg.com">
<link rel="dns-prefetch" href="//img13.static.yhbimg.com">
{{#if rlsEnv}}
<link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/{{version}}/index.css">
<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css">
{{/if}}
{{#if preEnv}}
<link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/{{version}}/index.css">
<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css">
{{/if}}
{{#if testEnv}}
<link rel="stylesheet" href="//cdn.yoho.cn/myohobuy/{{version}}/index.css">
<link rel="stylesheet" href="http://cdn.yoho.cn/myohobuy/{{version}}/index.css">
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="//static.dev.yohobuy.com/css/index.css">
<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
{{/if}}
<link rel="apple-touch-icon-precomposed" href="//static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="//static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="//static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
<link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
<link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
<link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
</head>
<body {{#if isPassportPage}}class=passport-body{{/if}}>
{{#if systemUpdate}}
... ...
... ... @@ -36,7 +36,7 @@
<link rel="stylesheet" href="/dist/myohobuy/{{version}}/index.css">
{{/if}}
{{#if devEnv}}
<link rel="stylesheet" href="//static.dev.yohobuy.com/css/index.css">
<link rel="stylesheet" href="http://static.dev.yohobuy.com/css/index.css">
{{/if}}
</head>
<body {{#if isPassportPage}}class=passport-body{{/if}}>
... ...
... ... @@ -66,13 +66,8 @@ class GradeModel
//username 调用获取用户基本信息数据,获得nikename昵称;
$result['vipGrade']['name'] = !empty($data['userProfile']) ? $data['userProfile']['nickname'] : '';
//跳转url(会员特权详情)
$allUrl = Helpers::url('/home/preferential', null);
$result['vipGrade']['allUrl'] = strtr($allUrl, array('http://' => '//'));
$result['vipGrade']['allUrl'] = Helpers::url('/home/preferential', null);
//当前vip等级享受的特权
foreach ($data['grade']['enjoy_preferential'] as &$value) {
$value['pic'] = strtr($value['pic'], array('http://' => '//'));
}
$result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
}
... ... @@ -111,9 +106,6 @@ class GradeModel
//调取接口获得数据
$data = GradeData::getPreferentialData($channel, $uid);
if (isset($data['code']) && $data['code'] == 200) {
foreach ($data['data'] as &$value) {
$value['pic'] = strtr($value['pic'], array('http://' => '//'));
}
$result['vipGrade']['privilege'] = $data['data'];
}
... ...
... ... @@ -123,7 +123,7 @@ class OrderModel
break;
}
$result['logisticUrl'] = $logistics['data']['url'];
$result['logisticImg'] = strtr($logistics['data']['logo'], array('http://' => '//'));
$result['logisticImg'] = $logistics['data']['logo'];
$result['logisticCompany'] = $logistics['data']['caption'];
$result['logisticNumber'] = $logistics['data']['express_number'];
... ...
... ... @@ -58,8 +58,7 @@ class CartModel
// 用户是否登录
if (empty($uid)) {
$signurl = Helpers::url('/signin.html', array('refer' => Helpers::url('/cart/index/index')));
$result['signurl'] = strtr($signurl, array('http://' => '//'));
$result['signurl'] = Helpers::url('/signin.html', array('refer' => Helpers::url('/cart/index/index')));
$result['showLoginInfo'] = true;
}
... ...
... ... @@ -473,8 +473,6 @@ class DetailModel
// 测量方式
if (!empty($sizeInfo['sizeImage'])) {
$sizeInfo['sizeImage'] = strtr($sizeInfo['sizeImage'], array('http://' => '//'));
$result['measurementMethod'] = array(
'title' => '测量方式',
'enTitle' => 'MEASUREMENT METHOD',
... ... @@ -503,7 +501,7 @@ class DetailModel
$result['reference']['detail']['list'][6]['params'] = array(0 => array('param' => '试穿描述')); // 试穿描述
foreach ($sizeInfo['modelBos'] as $value) {
$result['reference']['detail']['list'][0]['params'][] = array('param' => strtr($value['avatar'], array('http://' => '//')));
$result['reference']['detail']['list'][0]['params'][] = array('param' => $value['avatar']);
$result['reference']['detail']['list'][1]['params'][] = array('param' => $value['modelName']);
$result['reference']['detail']['list'][2]['params'][] = array('param' => $value['height']);
$result['reference']['detail']['list'][3]['params'][] = array('param' => $value['weight']);
... ... @@ -533,7 +531,7 @@ class DetailModel
);
foreach ($sizeInfo['productMaterialList'] as $value) {
$result['materials']['list'][] = array(
'img' => strtr($value['imageUrl'], array('http://' => '//')),
'img' => $value['imageUrl'],
'desc' => $value['remark'],
);
}
... ... @@ -543,11 +541,7 @@ class DetailModel
if (!empty($sizeInfo['washTipsBoList'])) {
$result['washTips']['list'] = array();
foreach ($sizeInfo['washTipsBoList'] as $value) {
//$result['washTips']['list'][] = $value;
$result['washTips']['list'][] = array(
'img' => strtr($value['img'], array('http://' => '//')),
'caption' => $value['caption'],
);
$result['washTips']['list'][] = $value;
}
}
... ... @@ -563,7 +557,6 @@ class DetailModel
'title' => '商品详情',
'enTitle' => 'DETAILS',
'desc' => strtr($productIntro, array(
'http://' => '//',
'\r\n\t' => '',
'</p>' => '',
'<img src=' => "<img class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=",
... ...
... ... @@ -55,7 +55,7 @@ class InfoController extends AbstractAction
// 作者信息数据
if (isset($detail['getAuthor']['name'])) {
$data['guang']['author'] = array();
$data['guang']['author']['avatar'] = strtr($detail['getAuthor']['avatar'], array('http://' => '//'));
$data['guang']['author']['avatar'] = $detail['getAuthor']['avatar'];
$data['guang']['author']['name'] = $detail['getAuthor']['name'];
$data['guang']['author']['intro'] = $detail['getAuthor']['author_desc'];
$data['guang']['author']['url'] = $isApp ? $detail['getAuthor']['url'] : Helpers::url('/author/index', array('id' => $detail['getArticle']['author_id']), 'guang');
... ... @@ -158,9 +158,6 @@ class InfoController extends AbstractAction
// 相关品牌
if (!empty($detail['getBrand'])) {
$data['relatedBrand'] = $detail['getBrand'];
foreach ($data['relatedBrand'] as &$value) {
$value['thumb'] = strtr($value['thumb'], array('http://' => '//'));
}
}
// 相关标签
... ...
... ... @@ -2,8 +2,8 @@
use Yaf\Application;
define('SITE_MAIN', '//m.dev.yohobuy.com'); // 网站主域名
define('OLD_MAIN', '//m.yohobuy.com'); // 网站旧域名
define('SITE_MAIN', 'http://m.dev.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.dev.yohobuy.com'); // 子域名后缀
define('USE_CACHE', false); // 缓存的开关
... ...
... ... @@ -2,8 +2,8 @@
use Yaf\Application;
define('SITE_MAIN', '//m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', '//m.yohobuy.com'); // 网站旧域名
define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.m.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('USE_CACHE', false); // 缓存的开关
... ...
... ... @@ -2,8 +2,8 @@
use Yaf\Application;
define('SITE_MAIN', '//m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', '//m.yohobuy.com'); // 网站旧域名
define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('USE_CACHE', false); // 缓存的开关
... ...
... ... @@ -2,8 +2,8 @@
use Yaf\Application;
define('SITE_MAIN', '//m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', '//m.yohobuy.com'); // 网站旧域名
define('SITE_MAIN', 'http://m.yohobuy.com'); // 网站主域名
define('OLD_MAIN', 'http://m.yohobuy.com'); // 网站旧域名
define('COOKIE_DOMAIN', '.yohobuy.com'); // COOKIE作用域
define('SUB_DOMAIN', '.m.yohobuy.com'); // 子域名后缀
define('USE_CACHE', true); // 缓存的开关
... ...