Browse Source

1.0.0:调试我的收藏

feature-1.0
chengkun 4 years ago
parent
commit
84b8bf57dd
  1. 2
      main.js
  2. 14
      pages/userInfo/myCollection/myCollection.vue
  3. 3
      utils/request.js

2
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;

14
pages/userInfo/myCollection/myCollection.vue

@ -1,6 +1,6 @@
<template>
<view>
<text>这是我的收藏</text>
<text @click="getMyCollection()">这是我的收藏</text>
</view>
</template>
@ -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: '我的收藏加载失败!',

3
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
}) :

Loading…
Cancel
Save