You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
2.6 KiB
62 lines
2.6 KiB
|
1 year ago
|
const http = uni.$u.http
|
||
|
|
|
||
|
|
// 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
|
||
|
|
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
|
||
|
|
const install = (Vue, vm) => {
|
||
|
|
// 此处没有使用传入的params参数
|
||
|
|
let getTenantInfo = (params, config = {}) => http.get('/blade-system/tenant/info', params, config)
|
||
|
|
// 此处使用了传入的params参数,一切自定义即可
|
||
|
|
let login = (params) => http.post('/blade-auth/oauth/token?' + params)
|
||
|
|
// 退出
|
||
|
|
let logout = () => http.get('/blade-auth/oauth/logout')
|
||
|
|
let register = (params, config = {}) => http.post('/blade-auth/oauth/token', params, config)
|
||
|
|
|
||
|
|
// 首页
|
||
|
|
let getworkbench = () => http.post('/blade-auth/oauth/token', params, config)
|
||
|
|
|
||
|
|
// 登录记录
|
||
|
|
let getLoginRecords = () => http.post('/blade-auth/oauth/token', params, config)
|
||
|
|
// 修改记录
|
||
|
|
let getEditRecords = () => http.post('/blade-auth/oauth/token', params, config)
|
||
|
|
// 意见反馈提交
|
||
|
|
let subEditRecords = (params) => http.post('/feedback/save', params)
|
||
|
|
// 获取意见反馈类型
|
||
|
|
|
||
|
|
// 业务类型查询
|
||
|
|
let getChildList = (params) => http.get('/blade-system/dict-biz/child-list', {...params }, {
|
||
|
|
authorization: false,
|
||
|
|
isparams: true
|
||
|
|
})
|
||
|
|
// 获取设备列表
|
||
|
|
let getDeviceList = (params) => http.get('/device/list', {...params }, {
|
||
|
|
authorization: false,
|
||
|
|
isparams: true
|
||
|
|
})
|
||
|
|
|
||
|
|
// 需求提报 提交接口
|
||
|
|
let workOrderSave = (params) => http.post('/workOrder/save', params, {
|
||
|
|
authorization: false,
|
||
|
|
isparams: false
|
||
|
|
})
|
||
|
|
// 需求提报 列表 /lab/workOrder/list
|
||
|
|
let getWorkOrderRecords = (params) => http.get('/workOrder/list', {...params }, {
|
||
|
|
authorization: false,
|
||
|
|
isparams: false
|
||
|
|
})
|
||
|
|
// 根据id查询故障详情
|
||
|
|
let getBreakdownInfo = (params) => http.get('/workOrder/detail', {...params }, {
|
||
|
|
authorization: false,
|
||
|
|
isparams: false
|
||
|
|
})
|
||
|
|
// 修改白送 /lab/workOrder/update
|
||
|
|
let workOrderupdate = (params) => http.post('/workOrder/update', params, {
|
||
|
|
authorization: false,
|
||
|
|
isparams: true
|
||
|
|
})
|
||
|
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||
|
|
vm.$u.api = { getTenantInfo, login, logout, register, getworkbench, getLoginRecords, getEditRecords, subEditRecords, getChildList, getDeviceList,workOrderSave,getWorkOrderRecords,getBreakdownInfo,workOrderupdate };
|
||
|
|
}
|
||
|
|
|
||
|
|
export default {
|
||
|
|
install
|
||
|
|
}
|