diff --git a/api/myCollection.js b/api/myCollection.js index db6de4a..679a48b 100644 --- a/api/myCollection.js +++ b/api/myCollection.js @@ -9,6 +9,5 @@ export function getCollectionList(data) { url: `${serviceTitle}/img/mini/tiktok/listTiktokCollection`, method: 'post', data: data - }) } diff --git a/main.js b/main.js index 755bb99..a8cfb6b 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ import App from './App' import store from './store/' -const baseURL = 'http://81.69.47.31:7010' +const baseURL = 'http://localhost:7010' Vue.prototype.baseURL = baseURL; diff --git a/pages/userInfo/myCollection/myCollection.vue b/pages/userInfo/myCollection/myCollection.vue index cfe4dd0..51c5bbc 100644 --- a/pages/userInfo/myCollection/myCollection.vue +++ b/pages/userInfo/myCollection/myCollection.vue @@ -1,6 +1,6 @@ @@ -13,23 +13,24 @@ } }, onLoad() { - //this.getMyCollection() + this.getMyCollection(1) }, methods: { - getMyCollection(){ + + getMyCollection(userId){ let data = { - "userId" : 1 - } - const res = getCollectionList(data) - if(res.data.code === 200){ - //this.banner = res.data.data - console.log('结果为:',res) - }else{ - uni.showModal({ - content: '我的收藏加载失败!', - showCancel: false - }); + } + const res = getCollectionList(data); + // if(res.data.code === 200){ + // //this.banner = res.data.data + // console.log('结果为:',res) + // }else{ + // uni.showModal({ + // content: '我的收藏加载失败!', + // showCancel: false + // }); + // } } } } diff --git a/utils/request.js b/utils/request.js index 98aa9ed..eddc004 100644 --- a/utils/request.js +++ b/utils/request.js @@ -16,15 +16,14 @@ service.interceptors.request.use( // // 给请求头添加user-token // config.headers["user-token"] = store.state.token; // } - config.headers = { - 'Content-Type': 'application/json' - } + config.headers['Content-Type'] = 'application/json'; config.method === 'post' ? config.data = qs.stringify({ ...config.data }) : config.params = { ...config.params }; console.log('请求拦截成功') + console.log(config) return config; }, error => {