Authored by 姜枫

fix ajax

'use strict';
const platformApi = new global.yoho.ApiBase(config.domains.platformApi, {
const platformApi = new global.yoho.ApiBase(global.yoho.config.domains.platformApi, {
name: 'imCs',
cache: global.yoho.cache,
useCache: false
... ... @@ -8,7 +8,7 @@ const platformApi = new global.yoho.ApiBase(config.domains.platformApi, {
const api = global.yoho.API;
const index = (req) => {
return api.get('/platform/product/material/canlogin', { uid: req.user.uid }).then(data => {
return platformApi.get('/platform/product/material/canlogin', { uid: req.user.uid }).then(data => {
console.log(data);
let params = {
brandId: 1,
... ... @@ -17,7 +17,7 @@ const index = (req) => {
page: 1
};
return api.get('/platform/product/material/getList', Object.assign({
return platformApi.get('/platform/product/material/getList', Object.assign({
method: ''
}, params), { cache: true });
});
... ...
... ... @@ -25,7 +25,7 @@ $(document).on('click', '#brand_container .nav span', function() {
/* 获取品牌数据*/
function getBrandList(_index, yh_channel) {
$.get('/material/newBrandList?yh_channel=' + yh_channel, data => {
$.get('/3party/material/newBrandList?yh_channel=' + yh_channel, data => {
let list = [];
list = Object.keys(data.data.all_list).map(item => {
return { name: item, content: data.data.all_list[item] };
... ... @@ -37,6 +37,6 @@ function getBrandList(_index, yh_channel) {
getBrandList(1, 1);
/* 获取品类数据*/
$.get('/material/getCategory', data => {
$.get('/3party/material/getCategory', data => {
console.log(data);
});
... ...