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.
64 lines
2.6 KiB
64 lines
2.6 KiB
import { data } from "../uni_modules/uview-ui/libs/mixin/mixin" |
|
|
|
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, data) => http.post('/blade-auth/oauth/token?' + params, data, { |
|
authorizations: true, |
|
isparams: true |
|
}) |
|
// 获取验证码 |
|
let getCode = () => http.get('blade-auth/oauth/captcha') |
|
|
|
// 获取质量列表 |
|
let getQualityList = (params) => http.get('/blade-quality/quality/userList',params, { |
|
authorizations: true, |
|
isparams: true |
|
}) |
|
|
|
// 获取商品详情 |
|
let getGoodsDetail = (params) => http.get('/blade-commodity/commodity/detail',params,{ |
|
authorizations: true, |
|
isparams: true |
|
}) |
|
|
|
// 获取所有商品数据 |
|
let getAllGoods = (params) => http.get('/blade-commodity/commodity/gteAllCommodity',params,{ |
|
authorizations:true, |
|
isparams:true |
|
}) |
|
|
|
// 提交反馈 |
|
let addQuality = (params) => http.post('/blade-quality/quality/save',params) |
|
// 获取问题类型字典 |
|
let getProblemType = () => http.get('/blade-system/dict/dictionary-tree?code=problem_type') |
|
// 获取处理状态字典 |
|
let getHandleStatus = () => http.get('/blade-system/dict/dictionary?code=problem_handle_status') |
|
// 退出 |
|
let logout = () => http.get('/blade-auth/oauth/logout') |
|
// 注册 |
|
let registerAccount = (data) => http.post('/blade-system/user/register-user',data) |
|
// 获取质量列表 |
|
let getOrderList = (params) => http.get('/salesOrder/list',params, { |
|
authorizations: true, |
|
isparams: true |
|
}) |
|
//新增订单 |
|
let addOrder = (data) => http.post('/salesOrder/save',data) |
|
// 订单详情 |
|
let getOrderDetail = (params) => http.get('/salesOrder/detail',params) |
|
//售后详情 |
|
let getFeekbackDetail = (params) => http.get('/blade-quality/quality/detail',params) |
|
|
|
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下 |
|
vm.$u.api = { getCode,registerAccount,getOrderDetail,getQualityList,getFeekbackDetail,addOrder,getOrderList,getTenantInfo, login, logout,getGoodsDetail,addQuality,getProblemType,getHandleStatus,getAllGoods }; |
|
} |
|
|
|
export default { |
|
install |
|
} |