diff --git a/src/api/api.js b/src/api/api.js new file mode 100644 index 0000000..86dd258 --- /dev/null +++ b/src/api/api.js @@ -0,0 +1,146 @@ +import service from '@/utils/request' + +// @Tags api +// @Summary 分页获取角色列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body modelInterface.PageInfo true "分页获取用户列表" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/getApiList [post] +// { +// page int +// pageSize int +// } +export const getApiList = (data) => { + return service({ + url: '/api/getApiList', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 创建基础api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateApiParams true "创建api" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/createApi [post] +export const createApi = (data) => { + return service({ + url: '/api/createApi', + method: 'post', + data + }) +} + +// @Tags menu +// @Summary 根据id获取菜单 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.GetById true "根据id获取菜单" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getApiById [post] +export const getApiById = (data) => { + return service({ + url: '/api/getApiById', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 更新api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateApiParams true "更新api" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /api/updateApi [post] +export const updateApi = (data) => { + return service({ + url: '/api/updateApi', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 更新api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateApiParams true "更新api" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /api/setAuthApi [post] +export const setAuthApi = (data) => { + return service({ + url: '/api/setAuthApi', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 获取所有的Api 不分页 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /api/getAllApis [post] +export const getAllApis = (data) => { + return service({ + url: '/api/getAllApis', + method: 'post', + data + }) +} + +// @Tags Api +// @Summary 删除指定api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.Api true "删除api" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /api/deleteApi [post] +export const deleteApi = (data) => { + return service({ + url: '/api/deleteApi', + method: 'post', + data + }) +} + +// @Tags SysApi +// @Summary 删除选中Api +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "ID" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /api/deleteApisByIds [delete] +export const deleteApisByIds = (data) => { + return service({ + url: '/api/deleteApisByIds', + method: 'delete', + data + }) +} + +// FreshCasbin +// @Tags SysApi +// @Summary 刷新casbin缓存 +// @accept application/json +// @Produce application/json +// @Success 200 {object} response.Response{msg=string} "刷新成功" +// @Router /api/freshCasbin [get] +export const freshCasbin = () => { + return service({ + url: '/api/freshCasbin', + method: 'get' + }) +} diff --git a/src/api/authority.js b/src/api/authority.js new file mode 100644 index 0000000..0401273 --- /dev/null +++ b/src/api/authority.js @@ -0,0 +1,85 @@ +import service from '@/utils/request' +// @Router /authority/getAuthorityList [post] +export const getAuthorityList = (data) => { + return service({ + url: '/authority/getAuthorityList', + method: 'post', + data + }) +} + +// @Summary 删除角色 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body {authorityId uint} true "删除角色" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /authority/deleteAuthority [post] +export const deleteAuthority = (data) => { + return service({ + url: '/authority/deleteAuthority', + method: 'post', + data + }) +} + +// @Summary 创建角色 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateAuthorityPatams true "创建角色" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /authority/createAuthority [post] +export const createAuthority = (data) => { + return service({ + url: '/authority/createAuthority', + method: 'post', + data + }) +} + +// @Tags authority +// @Summary 拷贝角色 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateAuthorityPatams true "拷贝角色" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"拷贝成功"}" +// @Router /authority/copyAuthority [post] +export const copyAuthority = (data) => { + return service({ + url: '/authority/copyAuthority', + method: 'post', + data + }) +} + +// @Summary 设置角色资源权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body sysModel.SysAuthority true "设置角色资源权限" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}" +// @Router /authority/setDataAuthority [post] +export const setDataAuthority = (data) => { + return service({ + url: '/authority/setDataAuthority', + method: 'post', + data + }) +} + +// @Summary 修改角色 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysAuthority true "修改角色" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}" +// @Router /authority/setDataAuthority [post] +export const updateAuthority = (data) => { + return service({ + url: '/authority/updateAuthority', + method: 'put', + data + }) +} diff --git a/src/api/authorityBtn.js b/src/api/authorityBtn.js new file mode 100644 index 0000000..9fe73bf --- /dev/null +++ b/src/api/authorityBtn.js @@ -0,0 +1,27 @@ + +import service from '@/utils/request' + +export const getAuthorityBtnApi = (data) => { + return service({ + url: '/authorityBtn/getAuthorityBtn', + method: 'post', + data + }) +} + +export const setAuthorityBtnApi = (data) => { + return service({ + url: '/authorityBtn/setAuthorityBtn', + method: 'post', + data + }) +} + +export const canRemoveAuthorityBtnApi = (params) => { + return service({ + url: '/authorityBtn/canRemoveAuthorityBtn', + method: 'post', + params + }) +} + diff --git a/src/api/autoCode.js b/src/api/autoCode.js new file mode 100644 index 0000000..abf1924 --- /dev/null +++ b/src/api/autoCode.js @@ -0,0 +1,142 @@ +import service from '@/utils/request' + +export const preview = (data) => { + return service({ + url: '/autoCode/preview', + method: 'post', + data + }) +} + +export const createTemp = (data) => { + return service({ + url: '/autoCode/createTemp', + method: 'post', + data, + responseType: 'blob' + }) +} + +// @Tags SysApi +// @Summary 获取当前所有数据库 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /autoCode/getDatabase [get] +export const getDB = (params) => { + return service({ + url: '/autoCode/getDB', + method: 'get', + params + }) +} + +// @Tags SysApi +// @Summary 获取当前数据库所有表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /autoCode/getTables [get] +export const getTable = (params) => { + return service({ + url: '/autoCode/getTables', + method: 'get', + params + }) +} + +// @Tags SysApi +// @Summary 获取当前数据库所有表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /autoCode/getColumn [get] +export const getColumn = (params) => { + return service({ + url: '/autoCode/getColumn', + method: 'get', + params + }) +} + +export const getSysHistory = (data) => { + return service({ + url: '/autoCode/getSysHistory', + method: 'post', + data + }) +} + +export const rollback = (data) => { + return service({ + url: '/autoCode/rollback', + method: 'post', + data + }) +} + +export const getMeta = (data) => { + return service({ + url: '/autoCode/getMeta', + method: 'post', + data + }) +} + +export const delSysHistory = (data) => { + return service({ + url: '/autoCode/delSysHistory', + method: 'post', + data + }) +} + +export const createPackageApi = (data) => { + return service({ + url: '/autoCode/createPackage', + method: 'post', + data + }) +} + +export const getPackageApi = () => { + return service({ + url: '/autoCode/getPackage', + method: 'post' + }) +} + +export const deletePackageApi = (data) => { + return service({ + url: '/autoCode/delPackage', + method: 'post', + data + }) +} + +export const createPlugApi = (data) => { + return service({ + url: '/autoCode/createPlug', + method: 'post', + data + }) +} + +export const installPlug = (data) => { + return service({ + url: '/autoCode/installPlug', + method: 'post', + data + }) +} + +export const pubPlug = (params) => { + return service({ + url: '/autoCode/pubPlug', + method: 'post', + params + }) +} diff --git a/src/api/breakpoint.js b/src/api/breakpoint.js new file mode 100644 index 0000000..1dbfba2 --- /dev/null +++ b/src/api/breakpoint.js @@ -0,0 +1,43 @@ +import service from '@/utils/request' +// @Summary 设置角色资源权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body sysModel.SysAuthority true "设置角色资源权限" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}" +// @Router /authority/setDataAuthority [post] + +export const findFile = (params) => { + return service({ + url: '/fileUploadAndDownload/findFile', + method: 'get', + params + }) +} + +export const breakpointContinue = (data) => { + return service({ + url: '/fileUploadAndDownload/breakpointContinue', + method: 'post', + donNotShowLoading: true, + headers: { 'Content-Type': 'multipart/form-data' }, + data + }) +} + +export const breakpointContinueFinish = (params) => { + return service({ + url: '/fileUploadAndDownload/breakpointContinueFinish', + method: 'post', + params + }) +} + +export const removeChunk = (data, params) => { + return service({ + url: '/fileUploadAndDownload/removeChunk', + method: 'post', + data, + params + }) +} diff --git a/src/api/casbin.js b/src/api/casbin.js new file mode 100644 index 0000000..802e130 --- /dev/null +++ b/src/api/casbin.js @@ -0,0 +1,32 @@ +import service from '@/utils/request' +// @Tags authority +// @Summary 更改角色api权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateAuthorityPatams true "更改角色api权限" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /casbin/UpdateCasbin [post] +export const UpdateCasbin = (data) => { + return service({ + url: '/casbin/updateCasbin', + method: 'post', + data + }) +} + +// @Tags casbin +// @Summary 获取权限列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.CreateAuthorityPatams true "获取权限列表" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /casbin/getPolicyPathByAuthorityId [post] +export const getPolicyPathByAuthorityId = (data) => { + return service({ + url: '/casbin/getPolicyPathByAuthorityId', + method: 'post', + data + }) +} diff --git a/src/api/companyPrice.js b/src/api/companyPrice.js new file mode 100755 index 0000000..108834c --- /dev/null +++ b/src/api/companyPrice.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags CompanyPrice +// @Summary 创建公司报价 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.CompanyPrice true "创建公司报价" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /companyPrice/createCompanyPrice [post] +export const createCompanyPrice = (data) => { + return service({ + url: '/companyPrice/createCompanyPrice', + method: 'post', + data + }) +} + +// @Tags CompanyPrice +// @Summary 删除公司报价 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.CompanyPrice true "删除公司报价" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /companyPrice/deleteCompanyPrice [delete] +export const deleteCompanyPrice = (params) => { + return service({ + url: '/companyPrice/deleteCompanyPrice', + method: 'delete', + params + }) +} + +// @Tags CompanyPrice +// @Summary 批量删除公司报价 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除公司报价" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /companyPrice/deleteCompanyPrice [delete] +export const deleteCompanyPriceByIds = (params) => { + return service({ + url: '/companyPrice/deleteCompanyPriceByIds', + method: 'delete', + params + }) +} + +// @Tags CompanyPrice +// @Summary 更新公司报价 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.CompanyPrice true "更新公司报价" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /companyPrice/updateCompanyPrice [put] +export const updateCompanyPrice = (data) => { + return service({ + url: '/companyPrice/updateCompanyPrice', + method: 'put', + data + }) +} + +// @Tags CompanyPrice +// @Summary 用id查询公司报价 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.CompanyPrice true "用id查询公司报价" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /companyPrice/findCompanyPrice [get] +export const findCompanyPrice = (params) => { + return service({ + url: '/companyPrice/findCompanyPrice', + method: 'get', + params + }) +} + +// @Tags CompanyPrice +// @Summary 分页获取公司报价列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取公司报价列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /companyPrice/getCompanyPriceList [get] +export const getCompanyPriceList = (params) => { + return service({ + url: '/companyPrice/getCompanyPriceList', + method: 'get', + params + }) +} diff --git a/src/api/crawl100ppi.js b/src/api/crawl100ppi.js new file mode 100755 index 0000000..153f3a4 --- /dev/null +++ b/src/api/crawl100ppi.js @@ -0,0 +1,113 @@ +import service from '@/utils/request' + +// @Tags Crawl100ppi +// @Summary 创建生意社爬虫数据 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Crawl100ppi true "创建生意社爬虫数据" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /crawl100ppi/createCrawl100ppi [post] +export const createCrawl100ppi = (data) => { + return service({ + url: '/crawl100ppi/createCrawl100ppi', + method: 'post', + data + }) +} + +// @Tags Crawl100ppi +// @Summary 删除生意社爬虫数据 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Crawl100ppi true "删除生意社爬虫数据" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /crawl100ppi/deleteCrawl100ppi [delete] +export const deleteCrawl100ppi = (params) => { + return service({ + url: '/crawl100ppi/deleteCrawl100ppi', + method: 'delete', + params + }) +} + +// @Tags Crawl100ppi +// @Summary 批量删除生意社爬虫数据 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除生意社爬虫数据" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /crawl100ppi/deleteCrawl100ppi [delete] +export const deleteCrawl100ppiByIds = (params) => { + return service({ + url: '/crawl100ppi/deleteCrawl100ppiByIds', + method: 'delete', + params + }) +} + +// @Tags Crawl100ppi +// @Summary 更新生意社爬虫数据 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Crawl100ppi true "更新生意社爬虫数据" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /crawl100ppi/updateCrawl100ppi [put] +export const updateCrawl100ppi = (data) => { + return service({ + url: '/crawl100ppi/updateCrawl100ppi', + method: 'put', + data + }) +} + +// @Tags Crawl100ppi +// @Summary 用id查询生意社爬虫数据 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.Crawl100ppi true "用id查询生意社爬虫数据" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /crawl100ppi/findCrawl100ppi [get] +export const findCrawl100ppi = (params) => { + return service({ + url: '/crawl100ppi/findCrawl100ppi', + method: 'get', + params + }) +} + +// @Tags Crawl100ppi +// @Summary 分页获取生意社爬虫数据列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取生意社爬虫数据列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /crawl100ppi/getCrawl100ppiList [get] +export const getCrawl100ppiList = (params) => { + return service({ + url: '/crawl100ppi/getCrawl100ppiList', + method: 'get', + params + }) +} + +// @Tags Crawl100ppi +// @Summary 批量重新同步爬虫数据 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量重新同步爬虫数据" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"同步成功"}" +// @Router /crawl100ppi/syncCrawl100ppi [put] +export const syncCrawl100ppi = (params) => { + return service({ + url: '/crawl100ppi/syncCrawl100ppi', + method: 'put', + params + }) +} diff --git a/src/api/crawlFieldReplace.js b/src/api/crawlFieldReplace.js new file mode 100755 index 0000000..dc54dcd --- /dev/null +++ b/src/api/crawlFieldReplace.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags CrawlFieldReplace +// @Summary 创建crawlFieldReplace表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.CrawlFieldReplace true "创建crawlFieldReplace表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /crawlFieldReplace/createCrawlFieldReplace [post] +export const createCrawlFieldReplace = (data) => { + return service({ + url: '/crawlFieldReplace/createCrawlFieldReplace', + method: 'post', + data + }) +} + +// @Tags CrawlFieldReplace +// @Summary 删除crawlFieldReplace表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.CrawlFieldReplace true "删除crawlFieldReplace表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /crawlFieldReplace/deleteCrawlFieldReplace [delete] +export const deleteCrawlFieldReplace = (params) => { + return service({ + url: '/crawlFieldReplace/deleteCrawlFieldReplace', + method: 'delete', + params + }) +} + +// @Tags CrawlFieldReplace +// @Summary 批量删除crawlFieldReplace表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除crawlFieldReplace表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /crawlFieldReplace/deleteCrawlFieldReplace [delete] +export const deleteCrawlFieldReplaceByIds = (params) => { + return service({ + url: '/crawlFieldReplace/deleteCrawlFieldReplaceByIds', + method: 'delete', + params + }) +} + +// @Tags CrawlFieldReplace +// @Summary 更新crawlFieldReplace表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.CrawlFieldReplace true "更新crawlFieldReplace表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /crawlFieldReplace/updateCrawlFieldReplace [put] +export const updateCrawlFieldReplace = (data) => { + return service({ + url: '/crawlFieldReplace/updateCrawlFieldReplace', + method: 'put', + data + }) +} + +// @Tags CrawlFieldReplace +// @Summary 用id查询crawlFieldReplace表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.CrawlFieldReplace true "用id查询crawlFieldReplace表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /crawlFieldReplace/findCrawlFieldReplace [get] +export const findCrawlFieldReplace = (params) => { + return service({ + url: '/crawlFieldReplace/findCrawlFieldReplace', + method: 'get', + params + }) +} + +// @Tags CrawlFieldReplace +// @Summary 分页获取crawlFieldReplace表列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取crawlFieldReplace表列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /crawlFieldReplace/getCrawlFieldReplaceList [get] +export const getCrawlFieldReplaceList = (params) => { + return service({ + url: '/crawlFieldReplace/getCrawlFieldReplaceList', + method: 'get', + params + }) +} diff --git a/src/api/customer.js b/src/api/customer.js new file mode 100644 index 0000000..4776f1c --- /dev/null +++ b/src/api/customer.js @@ -0,0 +1,80 @@ +import service from '@/utils/request' +// @Tags SysApi +// @Summary 删除客户 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.ExaCustomer true "删除客户" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /customer/customer [post] +export const createExaCustomer = (data) => { + return service({ + url: '/customer/customer', + method: 'post', + data + }) +} + +// @Tags SysApi +// @Summary 更新客户信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.ExaCustomer true "更新客户信息" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /customer/customer [put] +export const updateExaCustomer = (data) => { + return service({ + url: '/customer/customer', + method: 'put', + data + }) +} + +// @Tags SysApi +// @Summary 创建客户 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.ExaCustomer true "创建客户" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /customer/customer [delete] +export const deleteExaCustomer = (data) => { + return service({ + url: '/customer/customer', + method: 'delete', + data + }) +} + +// @Tags SysApi +// @Summary 获取单一客户信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body dbModel.ExaCustomer true "获取单一客户信息" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /customer/customer [get] +export const getExaCustomer = (params) => { + return service({ + url: '/customer/customer', + method: 'get', + params + }) +} + +// @Tags SysApi +// @Summary 获取权限客户列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body modelInterface.PageInfo true "获取权限客户列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /customer/customerList [get] +export const getExaCustomerList = (params) => { + return service({ + url: '/customer/customerList', + method: 'get', + params + }) +} diff --git a/src/api/email.js b/src/api/email.js new file mode 100644 index 0000000..c2f16f4 --- /dev/null +++ b/src/api/email.js @@ -0,0 +1,14 @@ +import service from '@/utils/request' +// @Tags email +// @Summary 发送测试邮件 +// @Security ApiKeyAuth +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" +// @Router /email/emailTest [post] +export const emailTest = (data) => { + return service({ + url: '/email/emailTest', + method: 'post', + data + }) +} diff --git a/src/api/exportTemplate.js b/src/api/exportTemplate.js new file mode 100644 index 0000000..5b7b278 --- /dev/null +++ b/src/api/exportTemplate.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags SysExportTemplate +// @Summary 创建导出模板 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysExportTemplate true "创建导出模板" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /sysExportTemplate/createSysExportTemplate [post] +export const createSysExportTemplate = (data) => { + return service({ + url: '/sysExportTemplate/createSysExportTemplate', + method: 'post', + data + }) +} + +// @Tags SysExportTemplate +// @Summary 删除导出模板 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysExportTemplate true "删除导出模板" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sysExportTemplate/deleteSysExportTemplate [delete] +export const deleteSysExportTemplate = (data) => { + return service({ + url: '/sysExportTemplate/deleteSysExportTemplate', + method: 'delete', + data + }) +} + +// @Tags SysExportTemplate +// @Summary 批量删除导出模板 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除导出模板" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sysExportTemplate/deleteSysExportTemplate [delete] +export const deleteSysExportTemplateByIds = (data) => { + return service({ + url: '/sysExportTemplate/deleteSysExportTemplateByIds', + method: 'delete', + data + }) +} + +// @Tags SysExportTemplate +// @Summary 更新导出模板 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysExportTemplate true "更新导出模板" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /sysExportTemplate/updateSysExportTemplate [put] +export const updateSysExportTemplate = (data) => { + return service({ + url: '/sysExportTemplate/updateSysExportTemplate', + method: 'put', + data + }) +} + +// @Tags SysExportTemplate +// @Summary 用id查询导出模板 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.SysExportTemplate true "用id查询导出模板" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /sysExportTemplate/findSysExportTemplate [get] +export const findSysExportTemplate = (params) => { + return service({ + url: '/sysExportTemplate/findSysExportTemplate', + method: 'get', + params + }) +} + +// @Tags SysExportTemplate +// @Summary 分页获取导出模板列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取导出模板列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysExportTemplate/getSysExportTemplateList [get] +export const getSysExportTemplateList = (params) => { + return service({ + url: '/sysExportTemplate/getSysExportTemplateList', + method: 'get', + params + }) +} diff --git a/src/api/fileUploadAndDownload.js b/src/api/fileUploadAndDownload.js new file mode 100644 index 0000000..0a5d021 --- /dev/null +++ b/src/api/fileUploadAndDownload.js @@ -0,0 +1,44 @@ +import service from '@/utils/request' +// @Tags FileUploadAndDownload +// @Summary 分页文件列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body modelInterface.PageInfo true "分页获取文件户列表" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /fileUploadAndDownload/getFileList [post] +export const getFileList = (data) => { + return service({ + url: '/fileUploadAndDownload/getFileList', + method: 'post', + data + }) +} + +// @Tags FileUploadAndDownload +// @Summary 删除文件 +// @Security ApiKeyAuth +// @Produce application/json +// @Param data body dbModel.FileUploadAndDownload true "传入文件里面id即可" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"返回成功"}" +// @Router /fileUploadAndDownload/deleteFile [post] +export const deleteFile = (data) => { + return service({ + url: '/fileUploadAndDownload/deleteFile', + method: 'post', + data + }) +} + +/** + * 编辑文件名或者备注 + * @param data + * @returns {*} + */ +export const editFileName = (data) => { + return service({ + url: '/fileUploadAndDownload/editFileName', + method: 'post', + data + }) +} diff --git a/src/api/initdb.js b/src/api/initdb.js new file mode 100644 index 0000000..f1eb2f4 --- /dev/null +++ b/src/api/initdb.js @@ -0,0 +1,27 @@ +import service from '@/utils/request' +// @Tags InitDB +// @Summary 初始化用户数据库 +// @Produce application/json +// @Param data body request.InitDB true "初始化数据库参数" +// @Success 200 {string} string "{"code":0,"data":{},"msg":"自动创建数据库成功"}" +// @Router /init/initdb [post] +export const initDB = (data) => { + return service({ + url: '/init/initdb', + method: 'post', + data, + donNotShowLoading: true + }) +} + +// @Tags CheckDB +// @Summary 初始化用户数据库 +// @Produce application/json +// @Success 200 {string} string "{"code":0,"data":{},"msg":"探测完成"}" +// @Router /init/checkdb [post] +export const checkDB = () => { + return service({ + url: '/init/checkdb', + method: 'post' + }) +} diff --git a/src/api/jwt.js b/src/api/jwt.js new file mode 100644 index 0000000..811ffc4 --- /dev/null +++ b/src/api/jwt.js @@ -0,0 +1,14 @@ +import service from '@/utils/request' +// @Tags jwt +// @Summary jwt加入黑名单 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"拉黑成功"}" +// @Router /jwt/jsonInBlacklist [post] +export const jsonInBlacklist = () => { + return service({ + url: '/jwt/jsonInBlacklist', + method: 'post' + }) +} diff --git a/src/api/menu.js b/src/api/menu.js new file mode 100644 index 0000000..163b5a6 --- /dev/null +++ b/src/api/menu.js @@ -0,0 +1,113 @@ +import service from '@/utils/request' +// @Summary 用户登录 获取动态路由 +// @Produce application/json +// @Param 可以什么都不填 调一下即可 +// @Router /menu/getMenu [post] +export const asyncMenu = () => { + return service({ + url: '/menu/getMenu', + method: 'post' + }) +} + +// @Summary 获取menu列表 +// @Produce application/json +// @Param { +// page int +// pageSize int +// } +// @Router /menu/getMenuList [post] +export const getMenuList = (data) => { + return service({ + url: '/menu/getMenuList', + method: 'post', + data + }) +} + +// @Summary 新增基础menu +// @Produce application/json +// @Param menu Object +// @Router /menu/getMenuList [post] +export const addBaseMenu = (data) => { + return service({ + url: '/menu/addBaseMenu', + method: 'post', + data + }) +} + +// @Summary 获取基础路由列表 +// @Produce application/json +// @Param 可以什么都不填 调一下即可 +// @Router /menu/getBaseMenuTree [post] +export const getBaseMenuTree = () => { + return service({ + url: '/menu/getBaseMenuTree', + method: 'post' + }) +} + +// @Summary 添加用户menu关联关系 +// @Produce application/json +// @Param menus Object authorityId string +// @Router /menu/getMenuList [post] +export const addMenuAuthority = (data) => { + return service({ + url: '/menu/addMenuAuthority', + method: 'post', + data + }) +} + +// @Summary 获取用户menu关联关系 +// @Produce application/json +// @Param authorityId string +// @Router /menu/getMenuAuthority [post] +export const getMenuAuthority = (data) => { + return service({ + url: '/menu/getMenuAuthority', + method: 'post', + data + }) +} + +// @Summary 删除menu +// @Produce application/json +// @Param ID float64 +// @Router /menu/deleteBaseMenu [post] +export const deleteBaseMenu = (data) => { + return service({ + url: '/menu/deleteBaseMenu', + method: 'post', + data + }) +} + +// @Summary 修改menu列表 +// @Produce application/json +// @Param menu Object +// @Router /menu/updateBaseMenu [post] +export const updateBaseMenu = (data) => { + return service({ + url: '/menu/updateBaseMenu', + method: 'post', + data + }) +} + +// @Tags menu +// @Summary 根据id获取菜单 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.GetById true "根据id获取菜单" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /menu/getBaseMenuById [post] +export const getBaseMenuById = (data) => { + return service({ + url: '/menu/getBaseMenuById', + method: 'post', + data + }) +} diff --git a/src/api/product.js b/src/api/product.js new file mode 100755 index 0000000..598d67f --- /dev/null +++ b/src/api/product.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags Product +// @Summary 创建产品表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Product true "创建产品表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /product/createProduct [post] +export const createProduct = (data) => { + return service({ + url: '/product/createProduct', + method: 'post', + data + }) +} + +// @Tags Product +// @Summary 删除产品表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Product true "删除产品表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /product/deleteProduct [delete] +export const deleteProduct = (params) => { + return service({ + url: '/product/deleteProduct', + method: 'delete', + params + }) +} + +// @Tags Product +// @Summary 批量删除产品表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除产品表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /product/deleteProduct [delete] +export const deleteProductByIds = (params) => { + return service({ + url: '/product/deleteProductByIds', + method: 'delete', + params + }) +} + +// @Tags Product +// @Summary 更新产品表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.Product true "更新产品表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /product/updateProduct [put] +export const updateProduct = (data) => { + return service({ + url: '/product/updateProduct', + method: 'put', + data + }) +} + +// @Tags Product +// @Summary 用id查询产品表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.Product true "用id查询产品表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /product/findProduct [get] +export const findProduct = (params) => { + return service({ + url: '/product/findProduct', + method: 'get', + params + }) +} + +// @Tags Product +// @Summary 分页获取产品表列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取产品表列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /product/getProductList [get] +export const getProductList = (params) => { + return service({ + url: '/product/getProductList', + method: 'get', + params + }) +} diff --git a/src/api/productCategory.js b/src/api/productCategory.js new file mode 100755 index 0000000..11b6c2c --- /dev/null +++ b/src/api/productCategory.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags ProductCategory +// @Summary 创建农资行情分类表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.ProductCategory true "创建农资行情分类表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /productCategory/createProductCategory [post] +export const createProductCategory = (data) => { + return service({ + url: '/productCategory/createProductCategory', + method: 'post', + data + }) +} + +// @Tags ProductCategory +// @Summary 删除农资行情分类表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.ProductCategory true "删除农资行情分类表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /productCategory/deleteProductCategory [delete] +export const deleteProductCategory = (params) => { + return service({ + url: '/productCategory/deleteProductCategory', + method: 'delete', + params + }) +} + +// @Tags ProductCategory +// @Summary 批量删除农资行情分类表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除农资行情分类表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /productCategory/deleteProductCategory [delete] +export const deleteProductCategoryByIds = (params) => { + return service({ + url: '/productCategory/deleteProductCategoryByIds', + method: 'delete', + params + }) +} + +// @Tags ProductCategory +// @Summary 更新农资行情分类表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.ProductCategory true "更新农资行情分类表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /productCategory/updateProductCategory [put] +export const updateProductCategory = (data) => { + return service({ + url: '/productCategory/updateProductCategory', + method: 'put', + data + }) +} + +// @Tags ProductCategory +// @Summary 用id查询农资行情分类表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.ProductCategory true "用id查询农资行情分类表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /productCategory/findProductCategory [get] +export const findProductCategory = (params) => { + return service({ + url: '/productCategory/findProductCategory', + method: 'get', + params + }) +} + +// @Tags ProductCategory +// @Summary 分页获取农资行情分类表列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取农资行情分类表列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /productCategory/getProductCategoryList [get] +export const getProductCategoryList = (params) => { + return service({ + url: '/productCategory/getProductCategoryList', + method: 'get', + params + }) +} diff --git a/src/api/productPrice.js b/src/api/productPrice.js new file mode 100755 index 0000000..31d019d --- /dev/null +++ b/src/api/productPrice.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags ProductPrice +// @Summary 创建产品价格 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.ProductPrice true "创建产品价格" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /productPrice/createProductPrice [post] +export const createProductPrice = (data) => { + return service({ + url: '/productPrice/createProductPrice', + method: 'post', + data + }) +} + +// @Tags ProductPrice +// @Summary 删除产品价格 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.ProductPrice true "删除产品价格" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /productPrice/deleteProductPrice [delete] +export const deleteProductPrice = (params) => { + return service({ + url: '/productPrice/deleteProductPrice', + method: 'delete', + params + }) +} + +// @Tags ProductPrice +// @Summary 批量删除产品价格 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除产品价格" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /productPrice/deleteProductPrice [delete] +export const deleteProductPriceByIds = (params) => { + return service({ + url: '/productPrice/deleteProductPriceByIds', + method: 'delete', + params + }) +} + +// @Tags ProductPrice +// @Summary 更新产品价格 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.ProductPrice true "更新产品价格" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /productPrice/updateProductPrice [put] +export const updateProductPrice = (data) => { + return service({ + url: '/productPrice/updateProductPrice', + method: 'put', + data + }) +} + +// @Tags ProductPrice +// @Summary 用id查询产品价格 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.ProductPrice true "用id查询产品价格" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /productPrice/findProductPrice [get] +export const findProductPrice = (params) => { + return service({ + url: '/productPrice/findProductPrice', + method: 'get', + params + }) +} + +// @Tags ProductPrice +// @Summary 分页获取产品价格列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取产品价格列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /productPrice/getProductPriceList [get] +export const getProductPriceList = (params) => { + return service({ + url: '/productPrice/getProductPriceList', + method: 'get', + params + }) +} diff --git a/src/api/sourcePrice.js b/src/api/sourcePrice.js new file mode 100755 index 0000000..a2f001e --- /dev/null +++ b/src/api/sourcePrice.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags SourcePrice +// @Summary 创建nzhq_source_price表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SourcePrice true "创建nzhq_source_price表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /sourcePrice/createSourcePrice [post] +export const createSourcePrice = (data) => { + return service({ + url: '/sourcePrice/createSourcePrice', + method: 'post', + data + }) +} + +// @Tags SourcePrice +// @Summary 删除nzhq_source_price表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SourcePrice true "删除nzhq_source_price表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sourcePrice/deleteSourcePrice [delete] +export const deleteSourcePrice = (params) => { + return service({ + url: '/sourcePrice/deleteSourcePrice', + method: 'delete', + params + }) +} + +// @Tags SourcePrice +// @Summary 批量删除nzhq_source_price表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除nzhq_source_price表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sourcePrice/deleteSourcePrice [delete] +export const deleteSourcePriceByIds = (params) => { + return service({ + url: '/sourcePrice/deleteSourcePriceByIds', + method: 'delete', + params + }) +} + +// @Tags SourcePrice +// @Summary 更新nzhq_source_price表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SourcePrice true "更新nzhq_source_price表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /sourcePrice/updateSourcePrice [put] +export const updateSourcePrice = (data) => { + return service({ + url: '/sourcePrice/updateSourcePrice', + method: 'put', + data + }) +} + +// @Tags SourcePrice +// @Summary 用id查询nzhq_source_price表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.SourcePrice true "用id查询nzhq_source_price表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /sourcePrice/findSourcePrice [get] +export const findSourcePrice = (params) => { + return service({ + url: '/sourcePrice/findSourcePrice', + method: 'get', + params + }) +} + +// @Tags SourcePrice +// @Summary 分页获取nzhq_source_price表列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取nzhq_source_price表列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sourcePrice/getSourcePriceList [get] +export const getSourcePriceList = (params) => { + return service({ + url: '/sourcePrice/getSourcePriceList', + method: 'get', + params + }) +} diff --git a/src/api/sysDictionary.js b/src/api/sysDictionary.js new file mode 100644 index 0000000..f5d6c86 --- /dev/null +++ b/src/api/sysDictionary.js @@ -0,0 +1,80 @@ +import service from '@/utils/request' +// @Tags SysDictionary +// @Summary 创建SysDictionary +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionary true "创建SysDictionary" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysDictionary/createSysDictionary [post] +export const createSysDictionary = (data) => { + return service({ + url: '/sysDictionary/createSysDictionary', + method: 'post', + data + }) +} + +// @Tags SysDictionary +// @Summary 删除SysDictionary +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionary true "删除SysDictionary" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sysDictionary/deleteSysDictionary [delete] +export const deleteSysDictionary = (data) => { + return service({ + url: '/sysDictionary/deleteSysDictionary', + method: 'delete', + data + }) +} + +// @Tags SysDictionary +// @Summary 更新SysDictionary +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionary true "更新SysDictionary" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /sysDictionary/updateSysDictionary [put] +export const updateSysDictionary = (data) => { + return service({ + url: '/sysDictionary/updateSysDictionary', + method: 'put', + data + }) +} + +// @Tags SysDictionary +// @Summary 用id查询SysDictionary +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionary true "用id查询SysDictionary" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /sysDictionary/findSysDictionary [get] +export const findSysDictionary = (params) => { + return service({ + url: '/sysDictionary/findSysDictionary', + method: 'get', + params + }) +} + +// @Tags SysDictionary +// @Summary 分页获取SysDictionary列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.PageInfo true "分页获取SysDictionary列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysDictionary/getSysDictionaryList [get] +export const getSysDictionaryList = (params) => { + return service({ + url: '/sysDictionary/getSysDictionaryList', + method: 'get', + params + }) +} diff --git a/src/api/sysDictionaryDetail.js b/src/api/sysDictionaryDetail.js new file mode 100644 index 0000000..d4f8772 --- /dev/null +++ b/src/api/sysDictionaryDetail.js @@ -0,0 +1,80 @@ +import service from '@/utils/request' +// @Tags SysDictionaryDetail +// @Summary 创建SysDictionaryDetail +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionaryDetail true "创建SysDictionaryDetail" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysDictionaryDetail/createSysDictionaryDetail [post] +export const createSysDictionaryDetail = (data) => { + return service({ + url: '/sysDictionaryDetail/createSysDictionaryDetail', + method: 'post', + data + }) +} + +// @Tags SysDictionaryDetail +// @Summary 删除SysDictionaryDetail +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionaryDetail true "删除SysDictionaryDetail" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sysDictionaryDetail/deleteSysDictionaryDetail [delete] +export const deleteSysDictionaryDetail = (data) => { + return service({ + url: '/sysDictionaryDetail/deleteSysDictionaryDetail', + method: 'delete', + data + }) +} + +// @Tags SysDictionaryDetail +// @Summary 更新SysDictionaryDetail +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionaryDetail true "更新SysDictionaryDetail" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /sysDictionaryDetail/updateSysDictionaryDetail [put] +export const updateSysDictionaryDetail = (data) => { + return service({ + url: '/sysDictionaryDetail/updateSysDictionaryDetail', + method: 'put', + data + }) +} + +// @Tags SysDictionaryDetail +// @Summary 用id查询SysDictionaryDetail +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysDictionaryDetail true "用id查询SysDictionaryDetail" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /sysDictionaryDetail/findSysDictionaryDetail [get] +export const findSysDictionaryDetail = (params) => { + return service({ + url: '/sysDictionaryDetail/findSysDictionaryDetail', + method: 'get', + params + }) +} + +// @Tags SysDictionaryDetail +// @Summary 分页获取SysDictionaryDetail列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.PageInfo true "分页获取SysDictionaryDetail列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysDictionaryDetail/getSysDictionaryDetailList [get] +export const getSysDictionaryDetailList = (params) => { + return service({ + url: '/sysDictionaryDetail/getSysDictionaryDetailList', + method: 'get', + params + }) +} diff --git a/src/api/sysOperationRecord.js b/src/api/sysOperationRecord.js new file mode 100644 index 0000000..4428c03 --- /dev/null +++ b/src/api/sysOperationRecord.js @@ -0,0 +1,48 @@ +import service from '@/utils/request' +// @Tags SysOperationRecord +// @Summary 删除SysOperationRecord +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysOperationRecord true "删除SysOperationRecord" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sysOperationRecord/deleteSysOperationRecord [delete] +export const deleteSysOperationRecord = (data) => { + return service({ + url: '/sysOperationRecord/deleteSysOperationRecord', + method: 'delete', + data + }) +} + +// @Tags SysOperationRecord +// @Summary 删除SysOperationRecord +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "删除SysOperationRecord" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /sysOperationRecord/deleteSysOperationRecord [delete] +export const deleteSysOperationRecordByIds = (data) => { + return service({ + url: '/sysOperationRecord/deleteSysOperationRecordByIds', + method: 'delete', + data + }) +} + +// @Tags SysOperationRecord +// @Summary 分页获取SysOperationRecord列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.PageInfo true "分页获取SysOperationRecord列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /sysOperationRecord/getSysOperationRecordList [get] +export const getSysOperationRecordList = (params) => { + return service({ + url: '/sysOperationRecord/getSysOperationRecordList', + method: 'get', + params + }) +} diff --git a/src/api/system.js b/src/api/system.js new file mode 100644 index 0000000..27b715e --- /dev/null +++ b/src/api/system.js @@ -0,0 +1,42 @@ +import service from '@/utils/request' +// @Tags systrm +// @Summary 获取配置文件内容 +// @Security ApiKeyAuth +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" +// @Router /system/getSystemConfig [post] +export const getSystemConfig = () => { + return service({ + url: '/system/getSystemConfig', + method: 'post' + }) +} + +// @Tags system +// @Summary 设置配置文件内容 +// @Security ApiKeyAuth +// @Produce application/json +// @Param data body sysModel.System true +// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" +// @Router /system/setSystemConfig [post] +export const setSystemConfig = (data) => { + return service({ + url: '/system/setSystemConfig', + method: 'post', + data + }) +} + +// @Tags system +// @Summary 获取服务器运行状态 +// @Security ApiKeyAuth +// @Produce application/json +// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" +// @Router /system/getServerInfo [post] +export const getSystemState = () => { + return service({ + url: '/system/getServerInfo', + method: 'post', + donNotShowLoading: true + }) +} diff --git a/src/api/systemArea.js b/src/api/systemArea.js new file mode 100755 index 0000000..e76253a --- /dev/null +++ b/src/api/systemArea.js @@ -0,0 +1,97 @@ +import service from '@/utils/request' + +// @Tags SystemArea +// @Summary 创建地区 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SystemArea true "创建地区" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}" +// @Router /systemArea/createSystemArea [post] +export const createSystemArea = (data) => { + return service({ + url: '/systemArea/createSystemArea', + method: 'post', + data + }) +} + +// @Tags SystemArea +// @Summary 删除地区 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SystemArea true "删除地区" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /systemArea/deleteSystemArea [delete] +export const deleteSystemArea = (params) => { + return service({ + url: '/systemArea/deleteSystemArea', + method: 'delete', + params + }) +} + +// @Tags SystemArea +// @Summary 批量删除地区 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.IdsReq true "批量删除地区" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}" +// @Router /systemArea/deleteSystemArea [delete] +export const deleteSystemAreaByIds = (params) => { + return service({ + url: '/systemArea/deleteSystemAreaByIds', + method: 'delete', + params + }) +} + +// @Tags SystemArea +// @Summary 更新地区 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SystemArea true "更新地区" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}" +// @Router /systemArea/updateSystemArea [put] +export const updateSystemArea = (data) => { + return service({ + url: '/systemArea/updateSystemArea', + method: 'put', + data + }) +} + +// @Tags SystemArea +// @Summary 用id查询地区 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query model.SystemArea true "用id查询地区" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" +// @Router /systemArea/findSystemArea [get] +export const findSystemArea = (params) => { + return service({ + url: '/systemArea/findSystemArea', + method: 'get', + params + }) +} + +// @Tags SystemArea +// @Summary 分页获取地区列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data query request.PageInfo true "分页获取地区列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /systemArea/getSystemAreaList [get] +export const getSystemAreaList = (params) => { + return service({ + url: '/systemArea/getSystemAreaList', + method: 'get', + params + }) +} diff --git a/src/api/user.js b/src/api/user.js new file mode 100644 index 0000000..f1f3638 --- /dev/null +++ b/src/api/user.js @@ -0,0 +1,165 @@ +import service from '@/utils/request' +// @Summary 用户登录 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/login [post] +export const login = (data) => { + return service({ + url: '/base/login', + method: 'post', + data: data + }) +} + +// @Summary 获取验证码 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/captcha [post] +export const captcha = () => { + return service({ + url: '/base/captcha', + method: 'post' + }) +} + +// @Summary 用户注册 +// @Produce application/json +// @Param data body {username:"string",password:"string"} +// @Router /base/resige [post] +export const register = (data) => { + return service({ + url: '/user/admin_register', + method: 'post', + data: data + }) +} + +// @Summary 修改密码 +// @Produce application/json +// @Param data body {username:"string",password:"string",newPassword:"string"} +// @Router /user/changePassword [post] +export const changePassword = (data) => { + return service({ + url: '/user/changePassword', + method: 'post', + data: data + }) +} + +// @Tags User +// @Summary 分页获取用户列表 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body modelInterface.PageInfo true "分页获取用户列表" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/getUserList [post] +export const getUserList = (data) => { + return service({ + url: '/user/getUserList', + method: 'post', + data: data + }) +} + +// @Tags User +// @Summary 设置用户权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.SetUserAuth true "设置用户权限" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/setUserAuthority [post] +export const setUserAuthority = (data) => { + return service({ + url: '/user/setUserAuthority', + method: 'post', + data: data + }) +} + +// @Tags SysUser +// @Summary 删除用户 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body request.SetUserAuth true "删除用户" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/deleteUser [delete] +export const deleteUser = (data) => { + return service({ + url: '/user/deleteUser', + method: 'delete', + data: data + }) +} + +// @Tags SysUser +// @Summary 设置用户信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysUser true "设置用户信息" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/setUserInfo [put] +export const setUserInfo = (data) => { + return service({ + url: '/user/setUserInfo', + method: 'put', + data: data + }) +} + +// @Tags SysUser +// @Summary 设置用户信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body model.SysUser true "设置用户信息" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/setSelfInfo [put] +export const setSelfInfo = (data) => { + return service({ + url: '/user/setSelfInfo', + method: 'put', + data: data + }) +} + +// @Tags User +// @Summary 设置用户权限 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body api.setUserAuthorities true "设置用户权限" +// @Success 200 {string} json "{"success":true,"data":{},"msg":"修改成功"}" +// @Router /user/setUserAuthorities [post] +export const setUserAuthorities = (data) => { + return service({ + url: '/user/setUserAuthorities', + method: 'post', + data: data + }) +} + +// @Tags User +// @Summary 获取用户信息 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /user/getUserInfo [get] +export const getUserInfo = () => { + return service({ + url: '/user/getUserInfo', + method: 'get' + }) +} + +export const resetPassword = (data) => { + return service({ + url: '/user/resetPassword', + method: 'post', + data: data + }) +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..0d45a84 --- /dev/null +++ b/src/main.js @@ -0,0 +1,42 @@ +import 'element-plus/es/components/message/style/css' +import 'element-plus/es/components/loading/style/css' +import 'element-plus/es/components/notification/style/css' +import 'element-plus/es/components/message-box/style/css' +import './style/element_visiable.scss' +import { createApp } from 'vue' +// 引入前端初始化相关内容 +import './core/admin' +// 引入封装的router +import router from '@/router/index' +import '@/permission' +import run from '@/core/admin.js' +import auth from '@/directive/auth' +import { store } from '@/pinia' +import App from './App.vue' +import { initDom } from './utils/positionToCode' + +initDom() +/** + * @description 导入加载进度条,防止首屏加载时间过长,用户等待 + * + * */ +import Nprogress from 'nprogress' +import 'nprogress/nprogress.css' +Nprogress.configure({ showSpinner: false, ease: 'ease', speed: 500 }) +Nprogress.start() + +/** + * 无需在这块结束,会在路由中间件中结束此块内容 + * */ + +const app = createApp(App) +app.config.productionTip = false + +app + .use(run) + .use(store) + .use(auth) + .use(router) + .mount('#app') + +export default app diff --git a/src/permission.js b/src/permission.js new file mode 100644 index 0000000..390afa2 --- /dev/null +++ b/src/permission.js @@ -0,0 +1,122 @@ +import { useUserStore } from '@/pinia/modules/user' +import { useRouterStore } from '@/pinia/modules/router' +import getPageTitle from '@/utils/page' +import router from '@/router' +import Nprogress from 'nprogress' + +const whiteList = ['Login', 'Init'] + +const getRouter = async(userStore) => { + const routerStore = useRouterStore() + await routerStore.SetAsyncRouter() + await userStore.GetUserInfo() + const asyncRouters = routerStore.asyncRouters + asyncRouters.forEach(asyncRouter => { + router.addRoute(asyncRouter) + }) +} + +async function handleKeepAlive(to) { + if (to.matched.some(item => item.meta.keepAlive)) { + if (to.matched && to.matched.length > 2) { + for (let i = 1; i < to.matched.length; i++) { + const element = to.matched[i - 1] + if (element.name === 'layout') { + to.matched.splice(i, 1) + await handleKeepAlive(to) + } + // 如果没有按需加载完成则等待加载 + if (typeof element.components.default === 'function') { + await element.components.default() + await handleKeepAlive(to) + } + } + } + } +} + +router.beforeEach(async(to, from) => { + const routerStore = useRouterStore() + Nprogress.start() + const userStore = useUserStore() + to.meta.matched = [...to.matched] + handleKeepAlive(to) + const token = userStore.token + // 在白名单中的判断情况 + document.title = getPageTitle(to.meta.title, to) + if(to.meta.client) { + return true + } + if (whiteList.indexOf(to.name) > -1) { + if (token) { + if (!routerStore.asyncRouterFlag && whiteList.indexOf(from.name) < 0) { + await getRouter(userStore) + } + // token 可以解析但是却是不存在的用户 id 或角色 id 会导致无限调用 + if (userStore.userInfo?.authority?.defaultRouter != null) { + if (router.hasRoute(userStore.userInfo.authority.defaultRouter)) { + return { name: userStore.userInfo.authority.defaultRouter } + } else { + return { path: '/layout/404' } + } + } else { + // 强制退出账号 + userStore.ClearStorage() + return { + name: 'Login', + query: { + redirect: document.location.hash + } + } + } + } else { + return true + } + } else { + // 不在白名单中并且已经登录的时候 + if (token) { + // 添加flag防止多次获取动态路由和栈溢出 + if (!routerStore.asyncRouterFlag && whiteList.indexOf(from.name) < 0) { + await getRouter(userStore) + if (userStore.token) { + if (router.hasRoute(userStore.userInfo.authority.defaultRouter)) { + return { ...to, replace: true } + } else { + return { path: '/layout/404' } + } + } else { + return { + name: 'Login', + query: { redirect: to.href } + } + } + } else { + if (to.matched.length) { + return true + } else { + return { path: '/layout/404' } + } + } + } + // 不在白名单中并且未登录的时候 + if (!token) { + return { + name: 'Login', + query: { + redirect: document.location.hash + } + } + } + } +}) + +router.afterEach(() => { + // 路由加载完成后关闭进度条 + document.getElementsByClassName('main-cont main-right')[0]?.scrollTo(0, 0) + Nprogress.done() +}) + +router.onError(() => { + // 路由发生错误后销毁进度条 + Nprogress.remove() +})