function accountsIdentity(params, method) {
return new Promise((resolve) => {
wx.request({
url: `https://baidu.com/xxx/xxx`,
data: params,
method: method,
success: (data) => {
resolve(data.data)
}
})
})
}
module.exports = {
accountsIdentity
}
const axios = require('../../utils/axios.js') // 引用外部的js文件
const params = { type: 4, tenantId: 1164523599620829185 }
axios.accountsIdentity(params, 'get').then(res => {
console.log(res)
})