前端工作总结238-uni-设置请求参数
作者:互联网
// 如果没有通过拦截器配置域名的话,可以在这里写上完整的URL(加上域名部分)
//上传图片
let uploadUrl = '/uploadFile/file';
//登录相关
let loginUrl = '/login/toLogin';
let logoutUrl = '/login/logout';
//市场相关url
let fireMapUrl = '/marketfiles/findFireFighting';
let mapUpdateUrl = '/marketfiles/uPFirefighting';
let boothMapUrl = '/marketfiles/findFireBooth';
//通知公告 党建等相关api
let partyAddUrl = '/fmtouchshow/addFmshow';
let partyDetailUrl = '/fmtouchshow/findById';
let partyListUrl = '/fmtouchshow/findFmShow';
//进货凭证相关
let PurchaseFindUrl = '/safetyreceipt/findReceipt';
let PurchaseAddUrl = '/safetyreceipt/addReceipt';
//供应商相关
let supplierFindUrl = '/safetysupplier/findSupplierByMid';
let supplierAddUrl = '/safetysupplier/addSupplier';
let supplierUpDateUrl = '/safetysupplier/addSupplier';
let supplierUpDelUrl = '/safetysupplier/removeSupplier';
//市场荣誉相关
let honorDelUrl = '/markeHhonour/delHonourById';
let honorAddUrl = '/markeHhonour/addMarketHonour';
let honorFindByIdUrl = '/markeHhonour/findHonourById';
let honorFindByMarketIdUrl = '/markeHhonour/findHonourByMarketId';
//摊位相关
let stallByStatusUrl = '/fmstall/findStallByStatus';
let stallAllGoodsTypeUrl = '/fmstall/findAllGoodsType';
let stallAllUrl = '/fmstall/findAll';
let stallAddUrl = '/fmstall/addStall';
//销毁凭证相关
let destroyAddUrl = '/safetyDestroy/add';
let destroyListUrl = '/safetyDestroy/list';
//制度相关
let institutionAddUrl = '/institution/addInstitution';
let institutionDelUrl = '/institution/delInstitutionById';
let institutionUpUrl = '/institution/upInstitution';
let institutionByIdUrl = '/institution/findInstitutionById';
let institutionUrl = '/institution/findInstitution';
//市场管理相关
let marketUrl = '/market/market';
let marketByIdUrl = '/market/findMarketById';
let marketUpUrl = '/market/upMarketInfo';
let marketAddrUrl = '/market/upMarketAddress';
//工单管理相关
let workOrderAddUrl = '/appWorkOrder/save';
let workOrderDetailUrl = '/appWorkOrder/queryById';
let workOrderOverUrl = '/appWorkOrder/isOverdue';
//管理员
let workOrderConfirmUrl_ = '/appWorkOrder/confirm';
let workOrderByStatusUrl_ = '/appWorkOrder/aqueryWorkOrderByStatus';
//用户
let workOrderByStatusUrl = '/appWorkOrder/uqueryWorkOrderByStatus';
let workOrderSub = '/appWorkOrder/upWorkOrder';
let findExAccounts= '/systemaccount/findExAccount';
//商品相关
let goodsUpUrl = '/goods/upGoods';
let goodsListUrl = '/goods/showGoodsPrice';
let goodsByIdUrl = '/goods/findGoodsById';
let goodsDel = '/goods/delGoodsById';
let goodsAddUrl = '/goods/addGoods';
//查询商品分类
let goodsCategoryUrl = '/goodscategory/findAll';
//商户信息相关
let merchantListUrl = '/merchant/queryMerchantInfo';
let merchantByIdUrl = '/merchant/queryMerchantInfoById';
let merchantAddUrl = '/merchant/addMerchant';
let merchantUpUrl = '/merchant/upMerchant';
//日常巡检相关
//我的的巡检任务
let patrolListUrl = '/appPatrol/findByDistributionId';
//根据巡检循环表id查询
let patrolByIdUrl = '/appPatrol/findByForId';
//日常巡检工作人员完成添加
let patrolAddUrl = '/appPatrol/save'
//检测信息相关
let testAddUrl = '/SafetyInspections/add';
let testListUrl = '/SafetyInspections/listPage';
//农贸宝典相关
//根据id查询法律法规等详情
let treasureByIdUrl = '/treasure/findById';
//分页查询查询法律法规,政策文件等相关api
let treasureListUrl = '/treasure/findTreasure';
//日常巡检-管理员管理
//日常巡检~查询我已发布的任务
let patrolAdminListUrl = '/appPatrolAdmin/findByAccountId';
//日常巡检~查询我的任务进展
let patrolAdminByTimeUrl = '/appPatrolAdmin/findAllByStartTimeGroupBy';
//日常巡检管理员添加
let patrolAdminAddUrl = '/appPatrolAdmin/save';
//数据字典
let dataDictionaryUrl = '/systemdic/findBycataPrimaryId'
const install = (Vue, vm) => {
//登录相关
let getLogin = (params = {}) => vm.$u.post(loginUrl, params);
let getLogout = (params = {}) => vm.$u.post(logoutUrl, params);
//市场相关
//消防图
let getFireMap = (params = {}) => vm.$u.get(fireMapUrl, params);
let getBoothMap = (params = {}) => vm.$u.get(boothMapUrl, params);
let getMapUpdate = (params = {}) => vm.$u.post(mapUpdateUrl, params);
//通知公告 党建等相关api
let getPartyAdd = (params = {}) => vm.$u.post(partyAddUrl, params);
let getPartyDetail = (params = {}) => vm.$u.get(partyDetailUrl, params);
let getpartyList = (params = {}) => vm.$u.get(partyListUrl, params);
//进货凭证相关api
let getPurchaseAdd = (params = {}) => vm.$u.post(PurchaseAddUrl, params);
let getPurchaseFind = (params = {}) => vm.$u.post(PurchaseFindUrl, params);
//供应商相关
let getSupplierFind = (params = {}) => vm.$u.get(supplierFindUrl, params);
let getSupplierAdd = (params = {}) => vm.$u.post(supplierAddUrl, params);
let getSupplierUpDate = (params = {}) => vm.$u.post(supplierUpDateUrl, params);
let getSupplierDeDate = (params = {}) => vm.$u.post(supplierUpDelUrl, params);
//市场荣誉相关
let getHonorDel = (params = {}) => vm.$u.get(honorDelUrl, params);
let getHonorAdd = (params = {}) => vm.$u.post(honorAddUrl, params);
let getHonorById = (params = {}) => vm.$u.get(honorFindByIdUrl, params);
let getHonorByMarketId = (params = {}) => vm.$u.get(honorFindByMarketIdUrl, params);
//摊位相关
let getStallAdd = (params = {}) => vm.$u.post(stallAddUrl, params);
let getStallAll = (params = {}) => vm.$u.post(stallAllUrl, params);
let getStallByStatus = (params = {}) => vm.$u.get(stallByStatusUrl, params);
let getStallByGoodsType = (params = {}) => vm.$u.post(stallAllGoodsTypeUrl, params);
//销毁凭证相关
let getDestroy = (params = {}) => vm.$u.get(destroyListUrl, params);
let getDestroyAdd = (params = {}) => vm.$u.post(destroyAddUrl, params);
//制度相关
let getInstitutionAdd = (params = {}) => vm.$u.post(institutionAddUrl, params);
let getInstitutionDel = (params = {}) => vm.$u.get(institutionDelUrl, params);
let getInstitutionUp = (params = {}) => vm.$u.post(institutionUpUrl, params);
let getInstitutionById = (params = {}) => vm.$u.get(institutionByIdUrl, params);
let getInstitution = (params = {}) => vm.$u.get(institutionUrl, params);
//市场管理相关
let getMarket = (params = {}) => vm.$u.get(marketUrl, params);
let getMarketById = (params = {}) => vm.$u.get(marketByIdUrl, params);
let getMarketUp = (params = {}) => vm.$u.post(marketUpUrl, params);
let getMarketAddr = (params = {}) => vm.$u.post(marketAddrUrl, params);
//用户相关
let findExAccount =(params = {}) => vm.$u.get(findExAccounts, params);
/*
* 工单管理相关
*/
//新增工单
let getWorkOrderAdd = (params = {}) => vm.$u.post(workOrderAddUrl, params);
//用户端-根据id查询工单详情
let getWorkOrderDetail = (params = {}) => vm.$u.get(workOrderDetailUrl, params);
//判断工单是否过期
let getWorkOrderOver = (params = {}) => vm.$u.get(workOrderOverUrl, params);
//管理员端确认用户完成工单
let getWorkOrderConfirm = (params = {}) => vm.$u.get(workOrderConfirmUrl_, params);
//管理员端-根据工单状态查询 (已发布,待确认,已完成)
let getWorkOrderByStatus = (params = {}) => vm.$u.get(workOrderByStatusUrl_, params);
//用户端-提交完成工单
let getWorkOrderSub = (params = {}) => vm.$u.post(workOrderSub, params);
//用户端-根据工单状态查询(待办,已办)
let getWorkOrder = (params = {}) => vm.$u.get(workOrderByStatusUrl, params);
//商户信息相关
let getMerchantList = (params = {}) => vm.$u.post(merchantListUrl, params);
let getMerchantById = (params = {}) => vm.$u.get(merchantByIdUrl, params);
let getMerchantAdd = (params = {}) => vm.$u.post(merchantAddUrl, params);
let getMerchantUp = (params = {}) => vm.$u.post(merchantUpUrl, params);
//商品相关
let getGoodsUp = (params = {}) => vm.$u.post(goodsUpUrl, params);
let getGoodsList = (params = {}) => vm.$u.get(goodsListUrl, params);
let getGoodsById = (params = {}) => vm.$u.get(goodsByIdUrl, params);
let getGoodsDel = (params = {}) => vm.$u.get(goodsDel, params);
let getGoodsAdd = (params = {}) => vm.$u.post(goodsAddUrl, params);
//查询商品分类
let getGoodsCategory = (params = {}) => vm.$u.get(goodsCategoryUrl, params);
//日常巡检相关
//我的的巡检任务
let getPatrolList = (params = {}) => vm.$u.get(patrolListUrl, params);
//根据巡检循环表
let getPatrolById = (params = {}) => vm.$u.get(patrolByIdUrl, params);
//日常巡检工作人员完成添加
let getPatrolAdd = (params = {}) => vm.$u.post(patrolAddUrl, params);
//检测信息相关
let getTestAdd = (params = {}) => vm.$u.post(testAddUrl, params);
let getTestList = (params = {}) => vm.$u.get(testListUrl, params);
//农贸宝典相关
//根据id查询法律法规等详情
let getTreasureById = (params = {}) => vm.$u.get(treasureByIdUrl, params);
//分页查询查询法律法规,政策文件等相关api
let getTreasureList = (params = {}) => vm.$u.post(treasureListUrl, params);
//日常巡检-管理员管理
//日常巡检~查询我已发布的任务
let getPatrolAdminList = (params = {}) => vm.$u.get(patrolAdminListUrl, params);
//日常巡检~查询我的任务进展
let getPatrolAdminByTime = (params = {}) => vm.$u.get(patrolAdminByTimeUrl, params);
//日常巡检管理员添加
let getPatrolAdminAdd = (params = {}) => vm.$u.post(patrolAdminAddUrl, params);
//上传
let uploadFile = (params = {}) => vm.$u.post(uploadUrl, params);
//数据字典
let getDataDictionary = (params = {}) => vm.$u.get(dataDictionaryUrl, params);
// 定义的接口名称
vm.$u.api = {
//登录相关
getLogin,
getLogout,
//市场相关
getFireMap,
getBoothMap,
getMapUpdate,
//党建通知相关
getPartyAdd,
getPartyDetail,
getpartyList,
//进货凭证相关
getPurchaseAdd,
getPurchaseFind,
//供应商相关
getSupplierFind,
getSupplierAdd,
getSupplierUpDate,
getSupplierDeDate,
//市场荣誉相关
getHonorDel,
getHonorAdd,
getHonorById,
getHonorByMarketId,
//摊位相关
getStallAdd,
getStallAll,
getStallByStatus,
getStallByGoodsType,
//销毁凭证相关
getDestroy,
getDestroyAdd,
//制度相关
getInstitutionAdd,
getInstitutionDel,
getInstitutionUp,
getInstitutionById,
getInstitution,
//市场管理相关
getMarket,
getMarketById,
getMarketUp,
getMarketAddr,
findExAccount,
//新增工单
getWorkOrderAdd,
getWorkOrderDetail,
getWorkOrderOver,
getWorkOrderConfirm,
getWorkOrderByStatus,
getWorkOrderSub,
getWorkOrder,
//商户信息相关
getMerchantList,
getMerchantById,
getMerchantAdd,
getMerchantUp,
//商品相关
getGoodsUp,
getGoodsList,
getGoodsById,
getGoodsDel,
getGoodsAdd,
//查询商品分类
getGoodsCategory,
//日常巡检相关
//我的的巡检任务
getPatrolList,
//根据巡检循环表
getPatrolById,
//日常巡检工作人员完成添加
getPatrolAdd,
//检测信息相关
getTestAdd,
getTestList,
//农贸宝典相关
//根据id查询法律法规等详情
getTreasureById,
//分页查询查询法律法规,政策文件等相关api
getTreasureList,
//日常巡检-管理员管理
//日常巡检~查询我已发布的任务
getPatrolAdminList,
//日常巡检~查询我的任务进展
getPatrolAdminByTime,
//日常巡检管理员添加
getPatrolAdminAdd,
//
uploadFile,
getDataDictionary,
};
}
export default {
install
}
标签:get,前端,vm,相关,let,238,params,uni,post 来源: https://www.cnblogs.com/yao-655442/p/16701553.html