接口函数.png
调取接口.png
js
import axios from 'axios'
import qs from 'qs'
//export const BASE_URL = 'http://www.gczzz.cn/website'
//export const BASE_URL = 'https://www.apiopen.top/'
//export const BASE_URL = '/api'
//export const BASE_URL = ''
// 首页api
// 单位列表
export const dwgllist = params => axios.post('/smp-ghg/EnterpConfMerge/getEnterpConfMergeList',qs.stringify(params))
// 单位列表
export const dwname = params => axios.get('/smp-ghg/bulletin/getBulletinByEnterpId',params)
// 举例01
export const getUserProductList = params => axios({
url: BASE_URL + '/product/product_select',
method: 'POST',
headers: {
'userid':sessionStorage.getItem('userid')
},
data:params
})
vue界面
mounted(){
this.dwgllist0(this.currentPage4,18,this.value1,this.value,this.value2)
this.dwname0({enterpId:1});
}
//单位列表
async dwgllist0(dwpage,dwsize,dwtiem,dwproper,dwinteger) {
const result = await dwgllist({
pageNum:dwpage,pageSize:2,createTime:dwtiem,property:dwproper,isImportant:dwinteger
});
if (result.data.code === this.$store.state.codes) {
this.dwsj=result.data.enterpConfMergeList.list
console.log(result)
}
},
//单位列表
async dwname0(params) {
const result = await dwname({params});
if (result.data.code === this.$store.state.codes) {
console.log(result,'0000000')
}
},
网友评论