From 7e21b83ee502ac6e77eec195eb3bfb6c394b2479 Mon Sep 17 00:00:00 2001 From: chengkun <2500338766@qq.com> Date: Thu, 5 May 2022 18:22:56 +0800 Subject: [PATCH] =?UTF-8?q?1.0.0=EF=BC=9A=E6=88=91=E7=9A=84=E6=94=B6?= =?UTF-8?q?=E8=97=8F=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/myCollection.js | 1 - main.js | 2 +- pages/userInfo/myCollection/myCollection.vue | 29 ++++++++++---------- utils/request.js | 5 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) 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 => {