Authored by 陈轩

Merge remote-tracking branch 'origin/release/5.1' into release/5.1

... ... @@ -184,6 +184,10 @@ exports.addressModify = (req, res, next) => {
* @param next
*/
exports.locationList = (req, res, next) => {
res.set({
'Cache-Control': 'max-age=600'
});
addressModel.locationList({
uid: req.user.uid
}).then(result => {
... ...
... ... @@ -155,6 +155,12 @@ const index = (req, res) => {
// ajax 请求分期专享商品
const getInstallmentGoods = (req, res) => {
let allowOrigin = _.get(req, 'headers.origin', null) ?
req.headers.origin : req.protocol + '://' + req.headers.host;
res.setHeader('Access-Control-Allow-Origin', allowOrigin);
res.setHeader('Access-Control-Allow-Credentials', 'true');
let params = req.query || {};
installmentModel.getSearchIntallment(params).then((result) => {
... ...
... ... @@ -193,6 +193,7 @@ function bindAddressListEvent(html) {
if (window.localStorage && window.localStorage.getItem) {
chinaAddressList = window.localStorage.getItem('chinaAddressList');
}
if (chinaAddressList) {
bindAddressListEvent(chinaAddressList);
} else {
... ... @@ -201,12 +202,14 @@ if (chinaAddressList) {
$.ajax({
method: 'GET',
url: '/home/locationList',
timeout: 60000
timeout: 60000,
cache: true
}).then(function(html) {
bindAddressListEvent(html);
if (window.localStorage && window.localStorage.setItem) {
window.localStorage.setItem('chinaAddressList', html);
}
// if (window.localStorage && window.localStorage.setItem) {
// window.localStorage.setItem('chinaAddressList', html);
// }
}).fail(function() {
tip.show('获取省市区列表失败');
});
... ...
... ... @@ -54,10 +54,13 @@ ListData.prototype.getListData = function(page) {
loading.showLoadingMask();
$.ajax({
type: 'GET',
url: self.opt.url,
url: 'http:' + '//m.yohobuy.com' + self.opt.url,
data: {
page: this.opt.page
},
xhrFields: {
withCredentials: true
},
dataType: 'html',
success: function(data) {
var $this, $title;
... ...
... ... @@ -51,7 +51,7 @@ require('../../common');
if (isApp) {
$.ajax({
type: 'GET',
url: '/product/index/shopAppCookie',
url: location.protocol + '//m.yohobuy.com/product/index/shopAppCookie',
xhrFields: {
withCredentials: true
},
... ... @@ -63,7 +63,7 @@ require('../../common');
$.ajax({
type: 'GET',
url: '/product/index/shopFav',
url: location.protocol + '//m.yohobuy.com/product/index/shopFav',
xhrFields: {
withCredentials: true
},
... ...