diff --git a/.env b/.env index a863648b..207ba0bb 100644 --- a/.env +++ b/.env @@ -1,3 +1,6 @@ +# 是否是微服务架构(重要) +VITE_IS_MICRO= false + # 前端加密密钥 VITE_PWD_ENC_KEY='pigxpigxpigxpigx' diff --git a/src/api/app/appmenu.ts b/src/api/app/appmenu.ts index eedbaa7e..3f2ecc2c 100644 --- a/src/api/app/appmenu.ts +++ b/src/api/app/appmenu.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export const pageList = (params?: Object) => { return request({ - url: '/admin/appmenu/tree', + url: '/app/appmenu/tree', method: 'get', params, }); @@ -10,14 +10,14 @@ export const pageList = (params?: Object) => { export const info = (id: String) => { return request({ - url: `/admin/appmenu/${id}`, + url: `/app/appmenu/${id}`, method: 'get', }); }; export const save = (data: Object) => { return request({ - url: '/admin/appmenu', + url: '/app/appmenu', method: 'post', data: data, }); @@ -25,7 +25,7 @@ export const save = (data: Object) => { export const update = (data: Object) => { return request({ - url: '/admin/appmenu', + url: '/app/appmenu', method: 'put', data: data, }); @@ -33,7 +33,7 @@ export const update = (data: Object) => { export const addObj = (data: Object) => { return request({ - url: '/admin/appmenu', + url: '/app/appmenu', method: 'post', data: data, }); @@ -41,7 +41,7 @@ export const addObj = (data: Object) => { export function delObj(ids?: object) { return request({ - url: '/admin/appmenu', + url: '/app/appmenu', method: 'delete', data: ids, }); @@ -49,14 +49,14 @@ export function delObj(ids?: object) { export function getDetails(obj: Object) { return request({ - url: '/admin/appmenu/details/' + obj, + url: '/app/appmenu/details/' + obj, method: 'get', }); } export function getDetailsByName(obj: Object) { return request({ - url: '/admin/appmenu/detailsByName/' + obj, + url: '/app/appmenu/detailsByName/' + obj, method: 'get', }); } diff --git a/src/api/app/approle.ts b/src/api/app/approle.ts index a3964f50..efdc94bc 100644 --- a/src/api/app/approle.ts +++ b/src/api/app/approle.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query: any) { return request({ - url: '/admin/approle/page', + url: '/app/approle/page', method: 'get', params: query, }); @@ -10,14 +10,14 @@ export function fetchList(query: any) { export function list() { return request({ - url: '/admin/approle/list', + url: '/app/approle/list', method: 'get', }); } export function addObj(obj: any) { return request({ - url: '/admin/approle', + url: '/app/approle', method: 'post', data: obj, }); @@ -25,14 +25,14 @@ export function addObj(obj: any) { export function getObj(id: string) { return request({ - url: '/admin/approle/' + id, + url: '/app/approle/' + id, method: 'get', }); } export function delObj(ids?: object) { return request({ - url: '/admin/approle', + url: '/app/approle', method: 'delete', data: ids, }); @@ -40,7 +40,7 @@ export function delObj(ids?: object) { export function putObj(obj: any) { return request({ - url: '/admin/approle', + url: '/app/approle', method: 'put', data: obj, }); @@ -48,14 +48,14 @@ export function putObj(obj: any) { export function fetchRoleTree(roleId: string) { return request({ - url: '/admin/appmenu/tree/' + roleId, + url: '/app/appmenu/tree/' + roleId, method: 'get', }); } export function permissionUpd(roleId: string, menuIds: string) { return request({ - url: '/admin/approle/menu', + url: '/app/approle/menu', method: 'put', data: { roleId: roleId, @@ -66,14 +66,14 @@ export function permissionUpd(roleId: string, menuIds: string) { export function getDetails(obj: Object) { return request({ - url: '/admin/approle/details/' + obj, + url: '/app/approle/details/' + obj, method: 'get', }); } export function getDetailsByCode(obj: Object) { return request({ - url: '/admin/approle/detailsByCode/' + obj, + url: '/app/approle/detailsByCode/' + obj, method: 'get', }); } diff --git a/src/api/app/approlemenu.ts b/src/api/app/approlemenu.ts index 869df5d0..d1dea83d 100644 --- a/src/api/app/approlemenu.ts +++ b/src/api/app/approlemenu.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query: any) { return request({ - url: '/admin/approlemenu/page', + url: '/app/approlemenu/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query: any) { export function addObj(obj: any) { return request({ - url: '/admin/approlemenu', + url: '/app/approlemenu', method: 'post', data: obj, }); @@ -18,21 +18,21 @@ export function addObj(obj: any) { export function getObj(id: string) { return request({ - url: '/admin/approlemenu/' + id, + url: '/app/approlemenu/' + id, method: 'get', }); } export function delObj(id: string) { return request({ - url: '/admin/approlemenu/' + id, + url: '/app/approlemenu/' + id, method: 'delete', }); } export function putObj(obj: string) { return request({ - url: '/admin/approlemenu', + url: '/app/approlemenu', method: 'put', data: obj, }); diff --git a/src/api/app/appsocial.ts b/src/api/app/appsocial.ts index b8f366a1..86d68953 100644 --- a/src/api/app/appsocial.ts +++ b/src/api/app/appsocial.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/admin/appsocial/page', + url: '/app/appsocial/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function addObj(obj?: Object) { return request({ - url: '/admin/appsocial', + url: '/app/appsocial', method: 'post', data: obj, }); @@ -18,14 +18,14 @@ export function addObj(obj?: Object) { export function getObj(id?: string) { return request({ - url: '/admin/appsocial/' + id, + url: '/app/appsocial/' + id, method: 'get', }); } export function delObj(ids?: object) { return request({ - url: '/admin/appsocial/', + url: '/app/appsocial/', method: 'delete', data: ids, }); @@ -33,7 +33,7 @@ export function delObj(ids?: object) { export function putObj(obj?: Object) { return request({ - url: '/admin/appsocial', + url: '/app/appsocial', method: 'put', data: obj, }); diff --git a/src/api/app/appuser.ts b/src/api/app/appuser.ts index d5a56a36..d8e4847c 100644 --- a/src/api/app/appuser.ts +++ b/src/api/app/appuser.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query: any) { return request({ - url: '/admin/appuser/page', + url: '/app/appuser/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query: any) { export function addObj(obj: any) { return request({ - url: '/admin/appuser', + url: '/app/appuser', method: 'post', data: obj, }); @@ -18,14 +18,14 @@ export function addObj(obj: any) { export function getObj(id: string) { return request({ - url: '/admin/appuser/' + id, + url: '/app/appuser/' + id, method: 'get', }); } export function delObj(ids?: object) { return request({ - url: '/admin/appuser/', + url: '/app/appuser/', method: 'delete', data: ids, }); @@ -33,7 +33,7 @@ export function delObj(ids?: object) { export function putObj(obj: any) { return request({ - url: '/admin/appuser', + url: '/app/appuser', method: 'put', data: obj, }); @@ -41,14 +41,14 @@ export function putObj(obj: any) { export function getDetails(obj: Object) { return request({ - url: '/admin/appuser/details/' + obj, + url: '/app/appuser/details/' + obj, method: 'get', }); } export function getDetailsByPhone(obj: Object) { return request({ - url: '/admin/appuser/detailsByPhone/' + obj, + url: '/app/appuser/detailsByPhone/' + obj, method: 'get', }); } diff --git a/src/api/app/appuserrole.ts b/src/api/app/appuserrole.ts index 7c3bc014..d355ce63 100644 --- a/src/api/app/appuserrole.ts +++ b/src/api/app/appuserrole.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query: any) { return request({ - url: '/admin/appuserrole/page', + url: '/app/appuserrole/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query: any) { export function addObj(obj: any) { return request({ - url: '/admin/appuserrole', + url: '/app/appuserrole', method: 'post', data: obj, }); @@ -18,21 +18,21 @@ export function addObj(obj: any) { export function getObj(id: string) { return request({ - url: '/admin/appuserrole/' + id, + url: '/app/appuserrole/' + id, method: 'get', }); } export function delObj(id: string) { return request({ - url: '/admin/appuserrole/' + id, + url: '/app/appuserrole/' + id, method: 'delete', }); } export function putObj(obj: any) { return request({ - url: '/admin/appuserrole', + url: '/app/appuserrole', method: 'put', data: obj, }); diff --git a/src/api/daemon/job-log.ts b/src/api/daemon/job-log.ts index e088735b..f48d1358 100644 --- a/src/api/daemon/job-log.ts +++ b/src/api/daemon/job-log.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query: any) { return request({ - url: '/admin/sys-job-log/page', + url: '/daemon/sys-job-log/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query: any) { export function delObjs(ids: object) { return request({ - url: '/admin/sys-job-log', + url: '/daemon/sys-job-log', method: 'delete', data: ids, }); diff --git a/src/api/daemon/job.ts b/src/api/daemon/job.ts index 332f2406..03a79be3 100644 --- a/src/api/daemon/job.ts +++ b/src/api/daemon/job.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/admin/sys-job/page', + url: '/daemon/sys-job/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function addObj(obj?: Object) { return request({ - url: '/admin/sys-job', + url: '/daemon/sys-job', method: 'post', data: obj, }); @@ -18,21 +18,21 @@ export function addObj(obj?: Object) { export function getObj(id?: string) { return request({ - url: '/admin/sys-job/' + id, + url: '/daemon/sys-job/' + id, method: 'get', }); } export function delObj(id?: string) { return request({ - url: '/admin/sys-job/' + id, + url: '/daemon/sys-job/' + id, method: 'delete', }); } export function putObj(obj?: Object) { return request({ - url: '/admin/sys-job', + url: '/daemon/sys-job', method: 'put', data: obj, }); @@ -40,21 +40,21 @@ export function putObj(obj?: Object) { export function startJobRa(jobId: string) { return request({ - url: '/admin/sys-job/start-job/' + jobId, + url: '/daemon/sys-job/start-job/' + jobId, method: 'post', }); } export function runJobRa(jobId: string) { return request({ - url: '/admin/sys-job/run-job/' + jobId, + url: '/daemon/sys-job/run-job/' + jobId, method: 'post', }); } export function shutDownJobRa(jobId: string) { return request({ - url: '/admin/sys-job/shutdown-job/' + jobId, + url: '/daemon/sys-job/shutdown-job/' + jobId, method: 'post', }); } diff --git a/src/api/login/index.ts b/src/api/login/index.ts index fff36292..0f1ff9ff 100644 --- a/src/api/login/index.ts +++ b/src/api/login/index.ts @@ -11,7 +11,7 @@ export const login = (data: any) => { const basicAuth = 'Basic ' + window.btoa(import.meta.env.VITE_OAUTH2_PASSWORD_CLIENT); Session.set('basicAuth', basicAuth); return request({ - url: '/admin/oauth2/token', + url: '/auth/oauth2/token', method: 'post', params: data, headers: { @@ -29,7 +29,7 @@ export const loginByMobile = (mobile: any, code: any) => { Session.set('basicAuth', basicAuth); return request({ - url: '/admin/oauth2/token', + url: '/auth/oauth2/token', headers: { isToken: false, 'TENANT-ID': '1', @@ -47,7 +47,7 @@ export const loginBySocial = (state: string, code: string) => { Session.set('basicAuth', basicAuth); return request({ - url: '/admin/oauth2/token', + url: '/auth/oauth2/token', headers: { isToken: false, 'TENANT-ID': '1', @@ -60,7 +60,7 @@ export const loginBySocial = (state: string, code: string) => { export const sendMobileCode = (mobile: any) => { return request({ - url: '/admin/mobile/' + mobile, + url: '/auth/mobile/' + mobile, method: 'get', }); }; @@ -72,7 +72,7 @@ export const refreshTokenApi = (refresh_token: string) => { const basicAuth = Session.get('basicAuth'); return request({ - url: '/admin/oauth2/token', + url: '/auth/oauth2/token', headers: { isToken: false, 'TENANT-ID': '1', @@ -90,7 +90,7 @@ export const refreshTokenApi = (refresh_token: string) => { export const checkToken = (refreshTime: number, refreshLock: boolean) => { const basicAuth = Session.get('basicAuth'); request({ - url: '/admin/token/check_token', + url: '/auth/token/check_token', headers: { isToken: false, Authorization: basicAuth, @@ -131,7 +131,7 @@ export const checkToken = (refreshTime: number, refreshLock: boolean) => { */ export const getUserInfo = () => { return request({ - url: '/admin/user/info', + url: '/auth/user/info', method: 'get', }); }; diff --git a/src/api/mp/wx-account-fans.ts b/src/api/mp/wx-account-fans.ts index a2fbf8ad..5ddcd11b 100644 --- a/src/api/mp/wx-account-fans.ts +++ b/src/api/mp/wx-account-fans.ts @@ -19,7 +19,7 @@ import request from '/@/utils/request'; export function fetchList(query) { return request({ - url: '/admin/wx-account-fans/page', + url: '/mp/wx-account-fans/page', method: 'get', params: query, }); @@ -27,7 +27,7 @@ export function fetchList(query) { export function addObj(obj) { return request({ - url: '/admin/wx-account-fans', + url: '/mp/wx-account-fans', method: 'post', data: obj, }); @@ -35,28 +35,28 @@ export function addObj(obj) { export function sync(appId) { return request({ - url: '/admin/wx-account-fans/sync/' + appId, + url: '/mp/wx-account-fans/sync/' + appId, method: 'post', }); } export function getObj(id) { return request({ - url: '/admin/wx-account-fans/' + id, + url: '/mp/wx-account-fans/' + id, method: 'get', }); } export function delObjs(id) { return request({ - url: '/admin/wx-account-fans/' + id, + url: '/mp/wx-account-fans/' + id, method: 'delete', }); } export function putObj(obj) { return request({ - url: '/admin/wx-account-fans', + url: '/mp/wx-account-fans', method: 'put', data: obj, }); @@ -64,7 +64,7 @@ export function putObj(obj) { export function black(obj, appid) { return request({ - url: '/admin/wx-account-fans/black/' + appid, + url: '/mp/wx-account-fans/black/' + appid, method: 'post', data: obj, }); @@ -72,7 +72,7 @@ export function black(obj, appid) { export function unblack(obj, appid) { return request({ - url: '/admin/wx-account-fans/unblack/' + appid, + url: '/mp/wx-account-fans/unblack/' + appid, method: 'post', data: obj, }); diff --git a/src/api/mp/wx-account-tag.ts b/src/api/mp/wx-account-tag.ts index d5dfb83c..51f2f52d 100644 --- a/src/api/mp/wx-account-tag.ts +++ b/src/api/mp/wx-account-tag.ts @@ -19,7 +19,7 @@ import request from '/@/utils/request'; export function getPage(query) { return request({ - url: '/admin/wx-account-tag/page', + url: '/mp/wx-account-tag/page', method: 'get', params: query, }); @@ -27,7 +27,7 @@ export function getPage(query) { export function addObj(obj) { return request({ - url: '/admin/wx-account-tag', + url: '/mp/wx-account-tag', method: 'post', data: obj, }); @@ -35,7 +35,7 @@ export function addObj(obj) { export function delObjs(obj) { return request({ - url: '/admin/wx-account-tag', + url: '/mp/wx-account-tag', method: 'delete', data: obj, }); @@ -43,7 +43,7 @@ export function delObjs(obj) { export function putObj(obj) { return request({ - url: '/admin/wx-account-tag', + url: '/mp/wx-account-tag', method: 'put', data: obj, }); @@ -51,14 +51,14 @@ export function putObj(obj) { export function sync(appId) { return request({ - url: '/admin/wx-account-tag/sync/' + appId, + url: '/mp/wx-account-tag/sync/' + appId, method: 'post', }); } export function list(appId) { return request({ - url: '/admin/wx-account-tag/list/', + url: '/mp/wx-account-tag/list/', method: 'get', params: { wxAccountAppid: appId }, }); diff --git a/src/api/mp/wx-account.ts b/src/api/mp/wx-account.ts index 13ff42e5..ab4c3fc6 100644 --- a/src/api/mp/wx-account.ts +++ b/src/api/mp/wx-account.ts @@ -19,7 +19,7 @@ import request from '/@/utils/request'; export function fetchList(query) { return request({ - url: '/admin/wx-account/page', + url: '/mp/wx-account/page', method: 'get', params: query, }); @@ -27,7 +27,7 @@ export function fetchList(query) { export function addObj(obj) { return request({ - url: '/admin/wx-account', + url: '/mp/wx-account', method: 'post', data: obj, }); @@ -35,35 +35,35 @@ export function addObj(obj) { export function getObj(id) { return request({ - url: '/admin/wx-account/' + id, + url: '/mp/wx-account/' + id, method: 'get', }); } export function generateQr(appid) { return request({ - url: '/admin/wx-account/qr/' + appid, + url: '/mp/wx-account/qr/' + appid, method: 'post', }); } export function clearQuota(appid) { return request({ - url: '/admin/wx-account/clear-quota/' + appid, + url: '/mp/wx-account/clear-quota/' + appid, method: 'post', }); } export function delObjs(id) { return request({ - url: '/admin/wx-account/' + id, + url: '/mp/wx-account/' + id, method: 'delete', }); } export function putObj(obj) { return request({ - url: '/admin/wx-account', + url: '/mp/wx-account', method: 'put', data: obj, }); @@ -71,14 +71,14 @@ export function putObj(obj) { export function fetchAccountList() { return request({ - url: '/admin/wx-account/list', + url: '/mp/wx-account/list', method: 'get', }); } export function fetchStatistics(q) { return request({ - url: '/admin/wx-account/statistics', + url: '/mp/wx-account/statistics', method: 'get', params: q, }); diff --git a/src/api/mp/wx-auto-reply.ts b/src/api/mp/wx-auto-reply.ts index 5d0d1237..2519c0c2 100644 --- a/src/api/mp/wx-auto-reply.ts +++ b/src/api/mp/wx-auto-reply.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function getPage(query) { return request({ - url: '/admin/wx-auto-reply/page', + url: '/mp/wx-auto-reply/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function getPage(query) { export function addObj(obj) { return request({ - url: '/admin/wx-auto-reply', + url: '/mp/wx-auto-reply', method: 'post', data: obj, }); @@ -18,21 +18,21 @@ export function addObj(obj) { export function getObj(id) { return request({ - url: '/admin/wx-auto-reply/' + id, + url: '/mp/wx-auto-reply/' + id, method: 'get', }); } export function delObj(id) { return request({ - url: '/admin/wx-auto-reply/' + id, + url: '/mp/wx-auto-reply/' + id, method: 'delete', }); } export function putObj(obj) { return request({ - url: '/admin/wx-auto-reply', + url: '/mp/wx-auto-reply', method: 'put', data: obj, }); diff --git a/src/api/mp/wx-fans-msg.ts b/src/api/mp/wx-fans-msg.ts index b7ef8e4b..05d620cd 100644 --- a/src/api/mp/wx-fans-msg.ts +++ b/src/api/mp/wx-fans-msg.ts @@ -19,7 +19,7 @@ import request from '/@/utils/request'; export function fetchList(query) { return request({ - url: '/admin/wx-fans-msg/page', + url: '/mp/wx-fans-msg/page', method: 'get', params: query, }); @@ -27,7 +27,7 @@ export function fetchList(query) { export function addObj(obj) { return request({ - url: '/admin/wx-fans-msg', + url: '/mp/wx-fans-msg', method: 'post', data: obj, }); @@ -35,21 +35,21 @@ export function addObj(obj) { export function getObj(id) { return request({ - url: '/admin/wxfansmsg/' + id, + url: '/mp/wxfansmsg/' + id, method: 'get', }); } export function delObjs(id) { return request({ - url: '/admin/wxfansmsg/' + id, + url: '/mp/wxfansmsg/' + id, method: 'delete', }); } export function putObj(obj) { return request({ - url: '/admin/wxfansmsg', + url: '/mp/wxfansmsg', method: 'put', data: obj, }); @@ -57,7 +57,7 @@ export function putObj(obj) { export function fetchResList(query) { return request({ - url: '/admin/wx-fans-msg/page', + url: '/mp/wx-fans-msg/page', method: 'get', params: query, }); @@ -65,7 +65,7 @@ export function fetchResList(query) { export function addResObj(obj) { return request({ - url: '/admin/wx-fans-msg', + url: '/mp/wx-fans-msg', method: 'post', data: obj, }); @@ -73,7 +73,7 @@ export function addResObj(obj) { export function delResObj(id) { return request({ - url: '/admin/wx-fans-msg/' + id, + url: '/mp/wx-fans-msg/' + id, method: 'delete', }); } diff --git a/src/api/mp/wx-material.ts b/src/api/mp/wx-material.ts index 1d327af3..31aa02e7 100644 --- a/src/api/mp/wx-material.ts +++ b/src/api/mp/wx-material.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function getPage(query) { return request({ - url: '/admin/wx-material/page', + url: '/mp/wx-material/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function getPage(query) { export function addObj(obj) { return request({ - url: '/admin/wx-material/materialNews', + url: '/mp/wx-material/materialNews', method: 'post', data: obj, }); @@ -18,7 +18,7 @@ export function addObj(obj) { export function materialNewsUpdate(obj) { return request({ - url: '/admin/wx-material/materialNews', + url: '/mp/wx-material/materialNews', method: 'put', data: obj, }); @@ -26,14 +26,14 @@ export function materialNewsUpdate(obj) { export function getObj(id) { return request({ - url: '/admin/wx-material/' + id, + url: '/mp/wx-material/' + id, method: 'get', }); } export function delObj(query) { return request({ - url: '/admin/wx-material', + url: '/mp/wx-material', method: 'delete', params: query, }); @@ -41,7 +41,7 @@ export function delObj(query) { export function putObj(obj) { return request({ - url: '/admin/wx-material', + url: '/mp/wx-material', method: 'put', data: obj, }); @@ -49,7 +49,7 @@ export function putObj(obj) { export function getMaterialOther(query) { return request({ - url: '/admin/wx-material/materialOther', + url: '/mp/wx-material/materialOther', method: 'get', params: query, responseType: 'blob', @@ -58,7 +58,7 @@ export function getMaterialOther(query) { export function getMaterialVideo(query) { return request({ - url: '/admin/wx-material/materialVideo', + url: '/mp/wx-material/materialVideo', method: 'get', params: query, }); @@ -66,7 +66,7 @@ export function getMaterialVideo(query) { export function getTempMaterialOther(query) { return request({ - url: '/admin/wx-material/tempMaterialOther', + url: '/mp/wx-material/tempMaterialOther', method: 'get', params: query, responseType: 'blob', diff --git a/src/api/mp/wx-menu.ts b/src/api/mp/wx-menu.ts index b40833a2..32350f95 100644 --- a/src/api/mp/wx-menu.ts +++ b/src/api/mp/wx-menu.ts @@ -19,14 +19,14 @@ import request from '/@/utils/request'; export function getObj(id) { return request({ - url: '/admin/wx-menu/' + id, + url: '/mp/wx-menu/' + id, method: 'get', }); } export function saveObj(appId, data) { return request({ - url: '/admin/wx-menu/' + appId, + url: '/mp/wx-menu/' + appId, method: 'post', data: data, }); @@ -34,7 +34,7 @@ export function saveObj(appId, data) { export function publishObj(id) { return request({ - url: '/admin/wx-menu/' + id, + url: '/mp/wx-menu/' + id, method: 'put', }); } diff --git a/src/api/oa/leave-bill.ts b/src/api/oa/leave-bill.ts index 6b6ab3ab..26c9ac8e 100644 --- a/src/api/oa/leave-bill.ts +++ b/src/api/oa/leave-bill.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query) { return request({ - url: '/admin/leave-bill/page', + url: '/act/leave-bill/page', method: 'get', params: query }) @@ -10,7 +10,7 @@ export function fetchList(query) { export function addObj(obj) { return request({ - url: '/admin/leave-bill', + url: '/act/leave-bill', method: 'post', data: obj }) @@ -18,21 +18,21 @@ export function addObj(obj) { export function getObj(id) { return request({ - url: '/admin/leave-bill/' + id, + url: '/act/leave-bill/' + id, method: 'get' }) } export function submit(id) { return request({ - url: '/admin/leave-bill/submit/' + id, + url: '/act/leave-bill/submit/' + id, method: 'get' }) } export function delObj(ids?: Object) { return request({ - url: '/admin/leave-bill', + url: '/act/leave-bill', method: 'delete', data: ids }) @@ -40,7 +40,7 @@ export function delObj(ids?: Object) { export function putObj(obj) { return request({ - url: '/admin/leave-bill/', + url: '/act/leave-bill/', method: 'put', data: obj }) diff --git a/src/api/oa/model.ts b/src/api/oa/model.ts index c1aef5ba..caed12b9 100644 --- a/src/api/oa/model.ts +++ b/src/api/oa/model.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query) { return request({ - url: '/admin/model', + url: '/act/model', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query) { export function delObj(ids: Object) { return request({ - url: '/admin/model', + url: '/act/model', method: 'delete', data: ids, }); @@ -18,14 +18,14 @@ export function delObj(ids: Object) { export function deploy(id) { return request({ - url: '/admin/model/deploy/' + id, + url: '/act/model/deploy/' + id, method: 'post', }); } export function addObj(obj?: Object) { return request({ - url: '/admin/model/insert', + url: '/act/model/insert', method: 'post', data: obj, }); @@ -33,14 +33,14 @@ export function addObj(obj?: Object) { export function getObj(id) { return request({ - url: '/admin/log/' + id, + url: '/act/log/' + id, method: 'get', }); } export function putObj(obj) { return request({ - url: '/admin/log/', + url: '/act/log/', method: 'put', data: obj, }); diff --git a/src/api/oa/process.ts b/src/api/oa/process.ts index 858db9f6..8ee84a29 100644 --- a/src/api/oa/process.ts +++ b/src/api/oa/process.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query) { return request({ - url: '/admin/process', + url: '/act/process', method: 'get', params: query }) @@ -10,7 +10,7 @@ export function fetchList(query) { export function delObj(ids?: Object) { return request({ - url: '/admin/process', + url: '/act/process', method: 'delete', data: ids }) @@ -18,7 +18,7 @@ export function delObj(ids?: Object) { export function status(id, type) { return request({ - url: '/admin/process/status/' + id + '/' + type, + url: '/act/process/status/' + id + '/' + type, method: 'put' }) } diff --git a/src/api/oa/task.ts b/src/api/oa/task.ts index 0ebac208..a185a99a 100644 --- a/src/api/oa/task.ts +++ b/src/api/oa/task.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query) { return request({ - url: '/admin/task/todo', + url: '/act/task/todo', method: 'get', params: query, }); @@ -10,21 +10,21 @@ export function fetchList(query) { export function fetchDetail(id) { return request({ - url: '/admin/task/' + id, + url: '/act/task/' + id, method: 'get', }); } export function fetchComment(id) { return request({ - url: '/admin/task/comment/' + id, + url: '/act/task/comment/' + id, method: 'get', }); } export function doTask(obj) { return request({ - url: '/admin/task', + url: '/act/task', method: 'post', data: obj, }); @@ -32,7 +32,7 @@ export function doTask(obj) { export function delObj(ids?:Object) { return request({ - url: '/admin/task', + url: '/act/task', method: 'delete', data: ids }) diff --git a/src/api/pay/cd.ts b/src/api/pay/cd.ts index 928ccdef..bc1645ce 100644 --- a/src/api/pay/cd.ts +++ b/src/api/pay/cd.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function useBuyApi(amount?: any) { return request({ - url: '/admin/goods/merge/buy', + url: '/pay/goods/merge/buy', method: 'get', params: { amount: amount }, }); diff --git a/src/api/pay/channel.ts b/src/api/pay/channel.ts index e0b3e1aa..036b9a05 100644 --- a/src/api/pay/channel.ts +++ b/src/api/pay/channel.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/admin/channel/page', + url: '/pay/channel/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function addObj(obj?: Object) { return request({ - url: '/admin/channel', + url: '/pay/channel', method: 'post', data: obj, }); @@ -18,14 +18,14 @@ export function addObj(obj?: Object) { export function getObj(id?: string) { return request({ - url: '/admin/channel/' + id, + url: '/pay/channel/' + id, method: 'get', }); } export function delObjs(ids?: Object) { return request({ - url: '/admin/channel', + url: '/pay/channel', method: 'delete', data: ids, }); @@ -33,7 +33,7 @@ export function delObjs(ids?: Object) { export function putObj(obj?: Object) { return request({ - url: '/admin/channel', + url: '/pay/channel', method: 'put', data: obj, }); diff --git a/src/api/pay/goods.ts b/src/api/pay/goods.ts index 1d40f607..ddeada8a 100644 --- a/src/api/pay/goods.ts +++ b/src/api/pay/goods.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/admin/goods/page', + url: '/pay/goods/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function addObj(obj?: Object) { return request({ - url: '/admin/goods', + url: '/pay/goods', method: 'post', data: obj, }); @@ -18,14 +18,14 @@ export function addObj(obj?: Object) { export function getObj(id?: string) { return request({ - url: '/admin/goods/' + id, + url: '/pay/goods/' + id, method: 'get', }); } export function delObjs(ids?: Object) { return request({ - url: '/admin/goods', + url: '/pay/goods', method: 'delete', data: ids, }); @@ -33,7 +33,7 @@ export function delObjs(ids?: Object) { export function putObj(obj?: Object) { return request({ - url: '/admin/goods', + url: '/pay/goods', method: 'put', data: obj, }); diff --git a/src/api/pay/record.ts b/src/api/pay/record.ts index f86249cc..036259ac 100644 --- a/src/api/pay/record.ts +++ b/src/api/pay/record.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/admin/notify/page', + url: '/pay/notify/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function addObj(obj?: Object) { return request({ - url: '/admin/notify', + url: '/pay/notify', method: 'post', data: obj, }); @@ -18,14 +18,14 @@ export function addObj(obj?: Object) { export function getObj(id?: string) { return request({ - url: '/admin/notify/' + id, + url: '/pay/notify/' + id, method: 'get', }); } export function delObjs(ids?: Object) { return request({ - url: '/admin/notify', + url: '/pay/notify', method: 'delete', data: ids, }); @@ -33,7 +33,7 @@ export function delObjs(ids?: Object) { export function putObj(obj?: Object) { return request({ - url: '/admin/notify', + url: '/pay/notify', method: 'put', data: obj, }); diff --git a/src/api/pay/refund.ts b/src/api/pay/refund.ts index 58b9ec50..fc0f9285 100644 --- a/src/api/pay/refund.ts +++ b/src/api/pay/refund.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/admin/refund/page', + url: '/pay/refund/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function useRefundApi(obj?: Object) { return request({ - url: '/admin/refund', + url: '/pay/refund', method: 'post', data: obj, }); @@ -25,7 +25,7 @@ export function getObj(id?: string) { export function delObjs(ids?: Object) { return request({ - url: '/admin/refund', + url: '/pay/refund', method: 'delete', data: ids, }); @@ -33,7 +33,7 @@ export function delObjs(ids?: Object) { export function putObj(obj?: Object) { return request({ - url: '/admin/refund', + url: '/pay/refund', method: 'put', data: obj, }); diff --git a/src/api/pay/trade.ts b/src/api/pay/trade.ts index 31a6391f..8592b293 100644 --- a/src/api/pay/trade.ts +++ b/src/api/pay/trade.ts @@ -2,7 +2,7 @@ import request from '/@/utils/request'; export function fetchList(query?: Object) { return request({ - url: '/admin/trade/page', + url: '/pay/trade/page', method: 'get', params: query, }); @@ -10,7 +10,7 @@ export function fetchList(query?: Object) { export function addObj(obj?: Object) { return request({ - url: '/admin/trade', + url: '/pay/trade', method: 'post', data: obj, }); @@ -18,14 +18,14 @@ export function addObj(obj?: Object) { export function getObj(id?: string) { return request({ - url: '/admin/trade/' + id, + url: '/pay/trade/' + id, method: 'get', }); } export function delObjs(ids?: Object) { return request({ - url: '/admin/trade', + url: '/pay/trade', method: 'delete', data: ids, }); @@ -33,7 +33,7 @@ export function delObjs(ids?: Object) { export function putObj(obj?: Object) { return request({ - url: '/admin/trade', + url: '/pay/trade', method: 'put', data: obj, }); diff --git a/src/components/Upload/Excel.vue b/src/components/Upload/Excel.vue index 7c45dcd1..4d688215 100644 --- a/src/components/Upload/Excel.vue +++ b/src/components/Upload/Excel.vue @@ -1,134 +1,135 @@ diff --git a/src/components/Upload/Image.vue b/src/components/Upload/Image.vue index 235cbe39..fbe9fbc2 100644 --- a/src/components/Upload/Image.vue +++ b/src/components/Upload/Image.vue @@ -5,7 +5,7 @@ import { useMessage } from '/@/hooks/message'; import { Local, Session } from '/@/utils/storage'; +import other from "/@/utils/other"; const props = defineProps({ modelValue: [String, Array], // 数量限制 diff --git a/src/utils/other.ts b/src/utils/other.ts index d27db5c5..364a1f50 100644 --- a/src/utils/other.ts +++ b/src/utils/other.ts @@ -12,6 +12,7 @@ import request from '/@/utils/request'; import { useMessage } from '/@/hooks/message'; // @ts-ignore import * as CryptoJS from 'crypto-js'; +import { validateNull } from './validate'; // 引入组件 const SvgIcon = defineAsyncComponent(() => import('/@/components/svgIcon/index.vue')); @@ -335,6 +336,9 @@ const other = { getQueryString: (url: string, paraName: string) => { return getQueryString(url, paraName); }, + adaptationUrl: (url?: string) => { + return adaptationUrl(url); + }, }; export function getQueryString(url: string, paraName: string) { @@ -401,5 +405,27 @@ export function toUnderline(str: string) { return str.replace(/([A-Z])/g, '_$1').toLowerCase(); } +/** + * 自动适配不同的后端架构 + * 1. 例如 /act/oa/task ,在微服务架构保持不变,在单体架构编程 /admin/oa/task + * 2. 特殊 /gen/xxx ,在微服务架构、单体架构编程 都需保持不变 + * + * @param originUrl 原始路径 + */ +const adaptationUrl = (originUrl?: string) => { + // 微服务架构 不做路径转换,为空不做路径转换 + const isMicro = import.meta.env.VITE_IS_MICRO; + if (validateNull(isMicro) || isMicro === true) { + return originUrl; + } + + // 如果是代码生成服务,不做路径转换 + if (originUrl?.startsWith('/gen')) { + return originUrl; + } + // 转为 /admin 路由前缀的请求 + return `/admin/${originUrl?.split('/').splice(2).join('/')}`; +}; + // 统一批量导出 export default other; diff --git a/src/utils/request.ts b/src/utils/request.ts index c0ee5687..9ccf4c9c 100644 --- a/src/utils/request.ts +++ b/src/utils/request.ts @@ -1,7 +1,8 @@ -import axios, { AxiosInstance, InternalAxiosRequestConfig } from 'axios'; +import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'; import { Session, Local } from '/@/utils/storage'; +import { useMessageBox } from '/@/hooks/message'; import qs from 'qs'; -import { useMessageBox } from '../hooks/message'; +import other from './other'; // 配置新建一个 axios 实例 const service: AxiosInstance = axios.create({ @@ -17,7 +18,7 @@ const service: AxiosInstance = axios.create({ // 添加请求拦截器 service.interceptors.request.use( - (config: InternalAxiosRequestConfig) => { + (config: AxiosRequestConfig) => { // get查询参数序列化 if (config.method === 'get') { // @ts-ignore @@ -37,6 +38,8 @@ service.interceptors.request.use( config.headers!['TENANT-ID'] = Local.get('tenantId'); } + //自动适配单体、微服务架构不同的URL + config.url = other.adaptationUrl(config.url); return config; }, (error) => { diff --git a/src/views/app/approle/index.vue b/src/views/app/approle/index.vue index 2e09a5c4..080d95ea 100644 --- a/src/views/app/approle/index.vue +++ b/src/views/app/approle/index.vue @@ -125,7 +125,7 @@ const handleSelectionChange = (objs: any) => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/approle/export', state.queryForm, 'approle.xlsx'); + downBlobFile('/app/approle/export', state.queryForm, 'approle.xlsx'); }; // 删除操作 diff --git a/src/views/app/appsocial/index.vue b/src/views/app/appsocial/index.vue index cab9c03e..5c3ea0c8 100644 --- a/src/views/app/appsocial/index.vue +++ b/src/views/app/appsocial/index.vue @@ -145,7 +145,7 @@ // 导出excel const exportExcel = () => { - downBlobFile('/admin/appsocial/export', state.queryForm, 'appsocial.xlsx'); + downBlobFile('/app/appsocial/export', state.queryForm, 'appsocial.xlsx'); }; // 删除操作 diff --git a/src/views/app/appuser/index.vue b/src/views/app/appuser/index.vue index f83dadef..b5ffdf51 100644 --- a/src/views/app/appuser/index.vue +++ b/src/views/app/appuser/index.vue @@ -146,7 +146,7 @@ const handleSelectionChange = (objs: any) => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/appuser/export', state.queryForm, 'users.xlsx'); + downBlobFile('/app/appuser/export', state.queryForm, 'users.xlsx'); }; // 删除用户 diff --git a/src/views/daemon/job-manage/index.vue b/src/views/daemon/job-manage/index.vue index 420f4641..fb657f3d 100644 --- a/src/views/daemon/job-manage/index.vue +++ b/src/views/daemon/job-manage/index.vue @@ -187,7 +187,7 @@ // 导出excel const exportExcel = () => { - downBlobFile('/admin/sys-job/export', state.queryForm, 'job.xlsx'); + downBlobFile('/daemon/sys-job/export', state.queryForm, 'job.xlsx'); }; const handleJobLog = (row: any) => { diff --git a/src/views/home/schedule/index.vue b/src/views/home/schedule/index.vue index e2c1bc31..cbe0aa4a 100644 --- a/src/views/home/schedule/index.vue +++ b/src/views/home/schedule/index.vue @@ -131,7 +131,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/schedule/export', state.queryForm, 'schedule.xlsx'); + downBlobFile('/daemon/schedule/export', state.queryForm, 'schedule.xlsx'); }; // 多选事件 diff --git a/src/views/mp/wx-account-fans/index.vue b/src/views/mp/wx-account-fans/index.vue index 68c5e464..e23ebee0 100644 --- a/src/views/mp/wx-account-fans/index.vue +++ b/src/views/mp/wx-account-fans/index.vue @@ -172,7 +172,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/fans/export', state.queryForm, 'fans.xlsx'); + downBlobFile('/mp/fans/export', state.queryForm, 'fans.xlsx'); }; // 多选事件 diff --git a/src/views/mp/wx-account-tag/index.vue b/src/views/mp/wx-account-tag/index.vue index 7f5cea65..46c9bd06 100644 --- a/src/views/mp/wx-account-tag/index.vue +++ b/src/views/mp/wx-account-tag/index.vue @@ -148,7 +148,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/wxAccountTag/export', state.queryForm, 'wxAccountTag.xlsx'); + downBlobFile('/mp/wxAccountTag/export', state.queryForm, 'wxAccountTag.xlsx'); }; // 多选事件 diff --git a/src/views/mp/wx-account/index.vue b/src/views/mp/wx-account/index.vue index 585d147b..efebdf85 100644 --- a/src/views/mp/wx-account/index.vue +++ b/src/views/mp/wx-account/index.vue @@ -134,7 +134,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/account/export', state.queryForm, 'account.xlsx'); + downBlobFile('/mp/account/export', state.queryForm, 'account.xlsx'); }; // 多选事件 diff --git a/src/views/mp/wx-fans-msg/index.vue b/src/views/mp/wx-fans-msg/index.vue index cb057624..4c78f6ba 100644 --- a/src/views/mp/wx-fans-msg/index.vue +++ b/src/views/mp/wx-fans-msg/index.vue @@ -180,7 +180,7 @@ onMounted(() => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/wxFansMsg/export', state.queryForm, 'wxFansMsg.xlsx'); + downBlobFile('/act/wxFansMsg/export', state.queryForm, 'wxFansMsg.xlsx'); }; // 多选事件 diff --git a/src/views/oa/leave_bill/index.vue b/src/views/oa/leave_bill/index.vue index 43c8518a..75487196 100644 --- a/src/views/oa/leave_bill/index.vue +++ b/src/views/oa/leave_bill/index.vue @@ -129,7 +129,7 @@ // 导出excel const exportExcel = () => { - downBlobFile('/admin/leave-bill/export', state.queryForm, 'leave.xlsx') + downBlobFile('/act/leave-bill/export', state.queryForm, 'leave.xlsx') } // 多选事件 @@ -166,4 +166,4 @@ }) }) } - \ No newline at end of file + diff --git a/src/views/oa/task/index.vue b/src/views/oa/task/index.vue index d7d26da9..4340ae3e 100644 --- a/src/views/oa/task/index.vue +++ b/src/views/oa/task/index.vue @@ -107,7 +107,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/task/export', state.queryForm, 'task.xlsx'); + downBlobFile('/act/task/export', state.queryForm, 'task.xlsx'); }; // 多选事件 diff --git a/src/views/pay/channel/index.vue b/src/views/pay/channel/index.vue index daebb8a4..f310822a 100644 --- a/src/views/pay/channel/index.vue +++ b/src/views/pay/channel/index.vue @@ -130,7 +130,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/channel/export', state.queryForm, 'channel.xlsx'); + downBlobFile('/pay/channel/export', state.queryForm, 'channel.xlsx'); }; // 多选事件 diff --git a/src/views/pay/order/index.vue b/src/views/pay/order/index.vue index 7c0f11d6..9d547eb8 100644 --- a/src/views/pay/order/index.vue +++ b/src/views/pay/order/index.vue @@ -131,7 +131,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/goods/export', state.queryForm, 'order.xlsx'); + downBlobFile('/pay/goods/export', state.queryForm, 'order.xlsx'); }; // 多选事件 diff --git a/src/views/pay/record/index.vue b/src/views/pay/record/index.vue index 321ac889..d0ef263c 100644 --- a/src/views/pay/record/index.vue +++ b/src/views/pay/record/index.vue @@ -102,7 +102,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/notify/export', state.queryForm, 'record.xlsx'); + downBlobFile('/pay/notify/export', state.queryForm, 'record.xlsx'); }; // 多选事件 diff --git a/src/views/pay/refund/index.vue b/src/views/pay/refund/index.vue index f19927b7..827843a4 100644 --- a/src/views/pay/refund/index.vue +++ b/src/views/pay/refund/index.vue @@ -108,7 +108,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/refund/export', state.queryForm, 'refund.xlsx'); + downBlobFile('/pay/refund/export', state.queryForm, 'refund.xlsx'); }; // 多选事件 diff --git a/src/views/pay/trade/index.vue b/src/views/pay/trade/index.vue index 18d60a8f..ef6740ab 100644 --- a/src/views/pay/trade/index.vue +++ b/src/views/pay/trade/index.vue @@ -153,7 +153,7 @@ const resetQuery = () => { // 导出excel const exportExcel = () => { - downBlobFile('/admin/trade/export', state.queryForm, 'trade.xlsx'); + downBlobFile('/pay/trade/export', state.queryForm, 'trade.xlsx'); }; // 多选事件