Authored by whb

index.js

@@ -472,11 +472,17 @@ class WebAction extends Controller_Abstract @@ -472,11 +472,17 @@ class WebAction extends Controller_Abstract
472 } else { 472 } else {
473 $channel = \Index\HomeModel::getSwitchChannel(); 473 $channel = \Index\HomeModel::getSwitchChannel();
474 } 474 }
  475 + if(APPLICATION_ENV == 'production' || APPLICATION_ENV == 'preview') {
  476 + $apiDomain = 'http://api.open.yohobuy.com';
  477 + } else {
  478 + $apiDomain = 'http://test.open.yohobuy.com';
  479 + }
475 $header = array( 480 $header = array(
476 'navbars'=> \Index\HomeModel::getNavBars($channel), 481 'navbars'=> \Index\HomeModel::getNavBars($channel),
477 'gobytype'=> 'gobuy'.$channel, 482 'gobytype'=> 'gobuy'.$channel,
478 'searchcate'=>'searchcate'.$channel, 483 'searchcate'=>'searchcate'.$channel,
479 'header'=> true, 484 'header'=> true,
  485 + 'apiDomain'=>''
480 ); 486 );
481 $this->_view->assign('headerdata', $header); 487 $this->_view->assign('headerdata', $header);
482 } 488 }
@@ -331,7 +331,7 @@ var handlebars = require("handlebars"); @@ -331,7 +331,7 @@ var handlebars = require("handlebars");
331 var json2 = require("index"); 331 var json2 = require("index");
332 var vipInfoCombine = null; //用户信息编译模板 332 var vipInfoCombine = null; //用户信息编译模板
333 var loginInfoCombine = null; //登录信息编译模板 333 var loginInfoCombine = null; //登录信息编译模板
334 -var apiDomain = 'http://api.open.yohobuy.com/'; //获取数据的地址http://api.open.yohobuy.com 334 +var apiDomain = $('#api-domain').val(); //获取数据的地址
335 var cartTpl = ''; //购物车模板 335 var cartTpl = ''; //购物车模板
336 /** 336 /**
337 * 搜寻的时候过滤非法字符(+-/:等非法字符单独出现) 337 * 搜寻的时候过滤非法字符(+-/:等非法字符单独出现)
@@ -388,6 +388,8 @@ var bannerMap = { @@ -388,6 +388,8 @@ var bannerMap = {
388 }; 388 };
389 var cookieMap = {}; 389 var cookieMap = {};
390 390
  391 +$('#api-domain').remove(); //删除信息表单
  392 +
391 function getSource(column, postition, event) { 393 function getSource(column, postition, event) {
392 try { 394 try {
393 dataLayer.push({ 395 dataLayer.push({
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.