Authored by 梁志锋

全站支持https的改造

... ... @@ -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));
return strtr($url, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
}
/**
... ... @@ -74,6 +74,7 @@ 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));
$url = strtr($url, array('http://' => '//'));
$filter = strstr($url, 'openby:yohobuy=', true);
if ($filter) {
return rtrim(rtrim($filter, '?'), '&');
... ... @@ -353,6 +354,10 @@ 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 'http://' . $domain . '/' . $bucket . $fileName;
return '//' . $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));
return strtr($fileName, array('{width}' => $width, '{height}' => $height, '{mode}' => $mode, 'http://' => '//'));
}
/**
... ...
... ... @@ -34,7 +34,7 @@ server
location ^~ /dist/ {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://cdn.yoho.cn/;
proxy_pass https://cdn.yoho.cn/;
}
location = /Passport/session/index {
... ...
... ... @@ -216,7 +216,7 @@ $('.btn-balance').on('touchend', function() {
}
});
$('.off-shell-goods').on('touchstart touchend', function() {
$('.off-shell-goods').on('touchstart touchend', function(e) {
var $this = $(e.target).closest('span');
if ($this.hasClass('icon-del')) {
... ...
... ... @@ -95,6 +95,7 @@ likeHammer.on('tap', function(e) {
success: function(data) {
if (data.code === 200) {
$this.toggleClass('like');
tip.show(data.message);
} else if (data.code === 400 || data.code === 412) {
location.href = data.data; //未登录跳转登录页面
} else {
... ...
... ... @@ -33,7 +33,7 @@
<p>浏览记录</p>
</a>
</div>
{{#if notice.open}}
<!-- {{#if notice.open}}
<div class="notice" data-time="{{notice.time}}">
{{#notice.list}}
<a class="notice-item item-{{@index}}" href="{{url}}">
... ... @@ -42,7 +42,7 @@
</a>
{{/notice.list}}
</div>
{{/if}}
{{/if}}-->
<div class="my-order">
<a class="order-title" href="/home/orders">
我的订单
... ...
{{> layout/header_passport}}
{{> layout/header}}
<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_passport}}
\ No newline at end of file
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header_passport}}
{{> layout/header}}
<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_passport}}
\ No newline at end of file
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header_passport}}
{{> layout/header}}
<div class="back-code-page passport-page yoho-page">
{{> passport/code}}
</div>
{{> layout/footer_passport}}
\ No newline at end of file
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header_passport}}
{{> layout/header}}
<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_passport}}
\ No newline at end of file
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header_passport}}
{{> layout/header}}
<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_passport}}
\ No newline at end of file
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header_passport}}
{{> layout/header}}
<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_passport}}
{{> layout/footer}}
... ...
{{> layout/header_passport}}
{{> layout/header}}
<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_passport}}
{{> layout/footer}}
... ...
{{> layout/header_passport}}
{{> layout/header}}
<div class="bind-password-page passport-page yoho-page">
<input type="hidden" id="openId" value="{{openId}}">
<input type="hidden" id="sourceType" value="{{sourceType}}">
... ... @@ -14,4 +14,4 @@
<input id="area-code" type="hidden" value={{areaCode}}>
<input id="token" type="hidden" value={{token}}>
</div>
{{> layout/footer_passport}}
{{> layout/footer}}
... ...
{{> layout/header_passport}}
{{> layout/header}}
<div class="login-page passport-page yoho-page">
{{> passport/header}}
<div class="content">
... ... @@ -41,4 +41,4 @@
</ul>
</div>
</div>
{{> layout/footer_passport}}
\ No newline at end of file
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header_passport}}
{{> layout/header}}
<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_passport}}
\ No newline at end of file
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@
<i class="close-icon iconfont">&#xe623;</i>
<div class="circle-rightbottom"></div>
</a>
<a href="//a.app.qq.com/o/simple.jsp?pkgname=com.yoho" id="float-layer-btn">
<a href="http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho" id="float-layer-btn">
立即下载
</a>
</div>
... ...
... ... @@ -66,9 +66,15 @@ class GradeModel
//username 调用获取用户基本信息数据,获得nikename昵称;
$result['vipGrade']['name'] = !empty($data['userProfile']) ? $data['userProfile']['nickname'] : '';
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/home/preferential', null);
$allUrl = Helpers::url('/home/preferential', null);
$result['vipGrade']['allUrl'] = strtr($allUrl, array('http://' => '//'));
//当前vip等级享受的特权
foreach ($data['grade']['enjoy_preferential'] as &$value) {
$value['pic'] = strtr($value['pic'], array('http://' => '//'));
}
$result['vipGrade']['privilege'] = $data['grade']['enjoy_preferential'];
}
if (USE_CACHE) {
... ... @@ -105,6 +111,9 @@ 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'];
}
... ...
... ... @@ -473,6 +473,8 @@ class DetailModel
// 测量方式
if (!empty($sizeInfo['sizeImage'])) {
$sizeInfo['sizeImage'] = strtr($sizeInfo['sizeImage'], array('http://' => '//'));
$result['measurementMethod'] = array(
'title' => '测量方式',
'enTitle' => 'MEASUREMENT METHOD',
... ... @@ -501,7 +503,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' => $value['avatar']);
$result['reference']['detail']['list'][0]['params'][] = array('param' => strtr($value['avatar'], array('http://' => '//')));
$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']);
... ... @@ -531,7 +533,7 @@ class DetailModel
);
foreach ($sizeInfo['productMaterialList'] as $value) {
$result['materials']['list'][] = array(
'img' => $value['imageUrl'],
'img' => strtr($value['imageUrl'], array('http://' => '//')),
'desc' => $value['remark'],
);
}
... ... @@ -557,6 +559,7 @@ 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=",
... ...
... ... @@ -252,7 +252,7 @@ class IndexController extends AbstractAction
$data = IndexModel::getPageData($gender, $sortId, $uid, $udid, $page, $tag, $authorId, $isApp, $showAuthor, $isTab);
} while (false);
if (isset($data)) {
if (isset($data) && !empty($data)) {
$this->_view->display('page', $data);
} else {
echo ' ';
... ...
... ... @@ -55,7 +55,7 @@ class InfoController extends AbstractAction
// 作者信息数据
if (isset($detail['getAuthor']['name'])) {
$data['guang']['author'] = array();
$data['guang']['author']['avatar'] = $detail['getAuthor']['avatar'];
$data['guang']['author']['avatar'] = strtr($detail['getAuthor']['avatar'], array('http://' => '//'));
$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,6 +158,9 @@ class InfoController extends AbstractAction
// 相关品牌
if (!empty($detail['getBrand'])) {
$data['relatedBrand'] = $detail['getBrand'];
foreach ($data['relatedBrand'] as &$value) {
$value['thumb'] = strtr($value['thumb'], array('http://' => '//'));
}
}
// 相关标签
... ...