diff --git a/main.js b/main.js index a8cfb6b..755bb99 100644 --- a/main.js +++ b/main.js @@ -1,7 +1,7 @@ import App from './App' import store from './store/' -const baseURL = 'http://localhost:7010' +const baseURL = 'http://81.69.47.31:7010' Vue.prototype.baseURL = baseURL; diff --git a/pages/userInfo/myCollection/myCollection.vue b/pages/userInfo/myCollection/myCollection.vue index b6f6fc8..cfe4dd0 100644 --- a/pages/userInfo/myCollection/myCollection.vue +++ b/pages/userInfo/myCollection/myCollection.vue @@ -1,6 +1,6 @@ @@ -13,17 +13,17 @@ } }, onLoad() { - this.getMyCollection(JSON.stringify(1)) + //this.getMyCollection() }, methods: { - getMyCollection(userId){ - const data = { - "userId" : userId + getMyCollection(){ + let data = { + "userId" : 1 } - const res = getCollectionList(JSON.stringify(data)) + const res = getCollectionList(data) if(res.data.code === 200){ //this.banner = res.data.data - console.log(res) + console.log('结果为:',res) }else{ uni.showModal({ content: '我的收藏加载失败!', diff --git a/utils/request.js b/utils/request.js index f29aabf..98aa9ed 100644 --- a/utils/request.js +++ b/utils/request.js @@ -16,6 +16,9 @@ service.interceptors.request.use( // // 给请求头添加user-token // config.headers["user-token"] = store.state.token; // } + config.headers = { + 'Content-Type': 'application/json' + } config.method === 'post' ? config.data = qs.stringify({ ...config.data }) :