Authored by 姜枫

fix ajax

1 'use strict'; 1 'use strict';
2 2
3 -const platformApi = new global.yoho.ApiBase(config.domains.platformApi, { 3 +const platformApi = new global.yoho.ApiBase(global.yoho.config.domains.platformApi, {
4 name: 'imCs', 4 name: 'imCs',
5 cache: global.yoho.cache, 5 cache: global.yoho.cache,
6 useCache: false 6 useCache: false
@@ -8,7 +8,7 @@ const platformApi = new global.yoho.ApiBase(config.domains.platformApi, { @@ -8,7 +8,7 @@ const platformApi = new global.yoho.ApiBase(config.domains.platformApi, {
8 const api = global.yoho.API; 8 const api = global.yoho.API;
9 9
10 const index = (req) => { 10 const index = (req) => {
11 - return api.get('/platform/product/material/canlogin', { uid: req.user.uid }).then(data => { 11 + return platformApi.get('/platform/product/material/canlogin', { uid: req.user.uid }).then(data => {
12 console.log(data); 12 console.log(data);
13 let params = { 13 let params = {
14 brandId: 1, 14 brandId: 1,
@@ -17,7 +17,7 @@ const index = (req) => { @@ -17,7 +17,7 @@ const index = (req) => {
17 page: 1 17 page: 1
18 }; 18 };
19 19
20 - return api.get('/platform/product/material/getList', Object.assign({ 20 + return platformApi.get('/platform/product/material/getList', Object.assign({
21 method: '' 21 method: ''
22 }, params), { cache: true }); 22 }, params), { cache: true });
23 }); 23 });
@@ -25,7 +25,7 @@ $(document).on('click', '#brand_container .nav span', function() { @@ -25,7 +25,7 @@ $(document).on('click', '#brand_container .nav span', function() {
25 25
26 /* 获取品牌数据*/ 26 /* 获取品牌数据*/
27 function getBrandList(_index, yh_channel) { 27 function getBrandList(_index, yh_channel) {
28 - $.get('/material/newBrandList?yh_channel=' + yh_channel, data => { 28 + $.get('/3party/material/newBrandList?yh_channel=' + yh_channel, data => {
29 let list = []; 29 let list = [];
30 list = Object.keys(data.data.all_list).map(item => { 30 list = Object.keys(data.data.all_list).map(item => {
31 return { name: item, content: data.data.all_list[item] }; 31 return { name: item, content: data.data.all_list[item] };
@@ -37,6 +37,6 @@ function getBrandList(_index, yh_channel) { @@ -37,6 +37,6 @@ function getBrandList(_index, yh_channel) {
37 getBrandList(1, 1); 37 getBrandList(1, 1);
38 38
39 /* 获取品类数据*/ 39 /* 获取品类数据*/
40 -$.get('/material/getCategory', data => { 40 +$.get('/3party/material/getCategory', data => {
41 console.log(data); 41 console.log(data);
42 }); 42 });