♻️ Refactoring code. 重构前端 api url 保持原有微服务请求前缀方式

This commit is contained in:
lbw 2023-03-09 18:41:36 +08:00
parent d8603d88fd
commit 5472d7593d
48 changed files with 301 additions and 266 deletions

3
.env
View File

@ -1,3 +1,6 @@
# 是否是微服务架构(重要)
VITE_IS_MICRO= false
# 前端加密密钥 # 前端加密密钥
VITE_PWD_ENC_KEY='pigxpigxpigxpigx' VITE_PWD_ENC_KEY='pigxpigxpigxpigx'

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export const pageList = (params?: Object) => { export const pageList = (params?: Object) => {
return request({ return request({
url: '/admin/appmenu/tree', url: '/app/appmenu/tree',
method: 'get', method: 'get',
params, params,
}); });
@ -10,14 +10,14 @@ export const pageList = (params?: Object) => {
export const info = (id: String) => { export const info = (id: String) => {
return request({ return request({
url: `/admin/appmenu/${id}`, url: `/app/appmenu/${id}`,
method: 'get', method: 'get',
}); });
}; };
export const save = (data: Object) => { export const save = (data: Object) => {
return request({ return request({
url: '/admin/appmenu', url: '/app/appmenu',
method: 'post', method: 'post',
data: data, data: data,
}); });
@ -25,7 +25,7 @@ export const save = (data: Object) => {
export const update = (data: Object) => { export const update = (data: Object) => {
return request({ return request({
url: '/admin/appmenu', url: '/app/appmenu',
method: 'put', method: 'put',
data: data, data: data,
}); });
@ -33,7 +33,7 @@ export const update = (data: Object) => {
export const addObj = (data: Object) => { export const addObj = (data: Object) => {
return request({ return request({
url: '/admin/appmenu', url: '/app/appmenu',
method: 'post', method: 'post',
data: data, data: data,
}); });
@ -41,7 +41,7 @@ export const addObj = (data: Object) => {
export function delObj(ids?: object) { export function delObj(ids?: object) {
return request({ return request({
url: '/admin/appmenu', url: '/app/appmenu',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -49,14 +49,14 @@ export function delObj(ids?: object) {
export function getDetails(obj: Object) { export function getDetails(obj: Object) {
return request({ return request({
url: '/admin/appmenu/details/' + obj, url: '/app/appmenu/details/' + obj,
method: 'get', method: 'get',
}); });
} }
export function getDetailsByName(obj: Object) { export function getDetailsByName(obj: Object) {
return request({ return request({
url: '/admin/appmenu/detailsByName/' + obj, url: '/app/appmenu/detailsByName/' + obj,
method: 'get', method: 'get',
}); });
} }

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query: any) { export function fetchList(query: any) {
return request({ return request({
url: '/admin/approle/page', url: '/app/approle/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,14 +10,14 @@ export function fetchList(query: any) {
export function list() { export function list() {
return request({ return request({
url: '/admin/approle/list', url: '/app/approle/list',
method: 'get', method: 'get',
}); });
} }
export function addObj(obj: any) { export function addObj(obj: any) {
return request({ return request({
url: '/admin/approle', url: '/app/approle',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -25,14 +25,14 @@ export function addObj(obj: any) {
export function getObj(id: string) { export function getObj(id: string) {
return request({ return request({
url: '/admin/approle/' + id, url: '/app/approle/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(ids?: object) { export function delObj(ids?: object) {
return request({ return request({
url: '/admin/approle', url: '/app/approle',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -40,7 +40,7 @@ export function delObj(ids?: object) {
export function putObj(obj: any) { export function putObj(obj: any) {
return request({ return request({
url: '/admin/approle', url: '/app/approle',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -48,14 +48,14 @@ export function putObj(obj: any) {
export function fetchRoleTree(roleId: string) { export function fetchRoleTree(roleId: string) {
return request({ return request({
url: '/admin/appmenu/tree/' + roleId, url: '/app/appmenu/tree/' + roleId,
method: 'get', method: 'get',
}); });
} }
export function permissionUpd(roleId: string, menuIds: string) { export function permissionUpd(roleId: string, menuIds: string) {
return request({ return request({
url: '/admin/approle/menu', url: '/app/approle/menu',
method: 'put', method: 'put',
data: { data: {
roleId: roleId, roleId: roleId,
@ -66,14 +66,14 @@ export function permissionUpd(roleId: string, menuIds: string) {
export function getDetails(obj: Object) { export function getDetails(obj: Object) {
return request({ return request({
url: '/admin/approle/details/' + obj, url: '/app/approle/details/' + obj,
method: 'get', method: 'get',
}); });
} }
export function getDetailsByCode(obj: Object) { export function getDetailsByCode(obj: Object) {
return request({ return request({
url: '/admin/approle/detailsByCode/' + obj, url: '/app/approle/detailsByCode/' + obj,
method: 'get', method: 'get',
}); });
} }

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query: any) { export function fetchList(query: any) {
return request({ return request({
url: '/admin/approlemenu/page', url: '/app/approlemenu/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query: any) {
export function addObj(obj: any) { export function addObj(obj: any) {
return request({ return request({
url: '/admin/approlemenu', url: '/app/approlemenu',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,21 +18,21 @@ export function addObj(obj: any) {
export function getObj(id: string) { export function getObj(id: string) {
return request({ return request({
url: '/admin/approlemenu/' + id, url: '/app/approlemenu/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(id: string) { export function delObj(id: string) {
return request({ return request({
url: '/admin/approlemenu/' + id, url: '/app/approlemenu/' + id,
method: 'delete', method: 'delete',
}); });
} }
export function putObj(obj: string) { export function putObj(obj: string) {
return request({ return request({
url: '/admin/approlemenu', url: '/app/approlemenu',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query?: Object) { export function fetchList(query?: Object) {
return request({ return request({
url: '/admin/appsocial/page', url: '/app/appsocial/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query?: Object) {
export function addObj(obj?: Object) { export function addObj(obj?: Object) {
return request({ return request({
url: '/admin/appsocial', url: '/app/appsocial',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,14 +18,14 @@ export function addObj(obj?: Object) {
export function getObj(id?: string) { export function getObj(id?: string) {
return request({ return request({
url: '/admin/appsocial/' + id, url: '/app/appsocial/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(ids?: object) { export function delObj(ids?: object) {
return request({ return request({
url: '/admin/appsocial/', url: '/app/appsocial/',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -33,7 +33,7 @@ export function delObj(ids?: object) {
export function putObj(obj?: Object) { export function putObj(obj?: Object) {
return request({ return request({
url: '/admin/appsocial', url: '/app/appsocial',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query: any) { export function fetchList(query: any) {
return request({ return request({
url: '/admin/appuser/page', url: '/app/appuser/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query: any) {
export function addObj(obj: any) { export function addObj(obj: any) {
return request({ return request({
url: '/admin/appuser', url: '/app/appuser',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,14 +18,14 @@ export function addObj(obj: any) {
export function getObj(id: string) { export function getObj(id: string) {
return request({ return request({
url: '/admin/appuser/' + id, url: '/app/appuser/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(ids?: object) { export function delObj(ids?: object) {
return request({ return request({
url: '/admin/appuser/', url: '/app/appuser/',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -33,7 +33,7 @@ export function delObj(ids?: object) {
export function putObj(obj: any) { export function putObj(obj: any) {
return request({ return request({
url: '/admin/appuser', url: '/app/appuser',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -41,14 +41,14 @@ export function putObj(obj: any) {
export function getDetails(obj: Object) { export function getDetails(obj: Object) {
return request({ return request({
url: '/admin/appuser/details/' + obj, url: '/app/appuser/details/' + obj,
method: 'get', method: 'get',
}); });
} }
export function getDetailsByPhone(obj: Object) { export function getDetailsByPhone(obj: Object) {
return request({ return request({
url: '/admin/appuser/detailsByPhone/' + obj, url: '/app/appuser/detailsByPhone/' + obj,
method: 'get', method: 'get',
}); });
} }

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query: any) { export function fetchList(query: any) {
return request({ return request({
url: '/admin/appuserrole/page', url: '/app/appuserrole/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query: any) {
export function addObj(obj: any) { export function addObj(obj: any) {
return request({ return request({
url: '/admin/appuserrole', url: '/app/appuserrole',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,21 +18,21 @@ export function addObj(obj: any) {
export function getObj(id: string) { export function getObj(id: string) {
return request({ return request({
url: '/admin/appuserrole/' + id, url: '/app/appuserrole/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(id: string) { export function delObj(id: string) {
return request({ return request({
url: '/admin/appuserrole/' + id, url: '/app/appuserrole/' + id,
method: 'delete', method: 'delete',
}); });
} }
export function putObj(obj: any) { export function putObj(obj: any) {
return request({ return request({
url: '/admin/appuserrole', url: '/app/appuserrole',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query: any) { export function fetchList(query: any) {
return request({ return request({
url: '/admin/sys-job-log/page', url: '/daemon/sys-job-log/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query: any) {
export function delObjs(ids: object) { export function delObjs(ids: object) {
return request({ return request({
url: '/admin/sys-job-log', url: '/daemon/sys-job-log',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query?: Object) { export function fetchList(query?: Object) {
return request({ return request({
url: '/admin/sys-job/page', url: '/daemon/sys-job/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query?: Object) {
export function addObj(obj?: Object) { export function addObj(obj?: Object) {
return request({ return request({
url: '/admin/sys-job', url: '/daemon/sys-job',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,21 +18,21 @@ export function addObj(obj?: Object) {
export function getObj(id?: string) { export function getObj(id?: string) {
return request({ return request({
url: '/admin/sys-job/' + id, url: '/daemon/sys-job/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(id?: string) { export function delObj(id?: string) {
return request({ return request({
url: '/admin/sys-job/' + id, url: '/daemon/sys-job/' + id,
method: 'delete', method: 'delete',
}); });
} }
export function putObj(obj?: Object) { export function putObj(obj?: Object) {
return request({ return request({
url: '/admin/sys-job', url: '/daemon/sys-job',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -40,21 +40,21 @@ export function putObj(obj?: Object) {
export function startJobRa(jobId: string) { export function startJobRa(jobId: string) {
return request({ return request({
url: '/admin/sys-job/start-job/' + jobId, url: '/daemon/sys-job/start-job/' + jobId,
method: 'post', method: 'post',
}); });
} }
export function runJobRa(jobId: string) { export function runJobRa(jobId: string) {
return request({ return request({
url: '/admin/sys-job/run-job/' + jobId, url: '/daemon/sys-job/run-job/' + jobId,
method: 'post', method: 'post',
}); });
} }
export function shutDownJobRa(jobId: string) { export function shutDownJobRa(jobId: string) {
return request({ return request({
url: '/admin/sys-job/shutdown-job/' + jobId, url: '/daemon/sys-job/shutdown-job/' + jobId,
method: 'post', method: 'post',
}); });
} }

View File

@ -11,7 +11,7 @@ export const login = (data: any) => {
const basicAuth = 'Basic ' + window.btoa(import.meta.env.VITE_OAUTH2_PASSWORD_CLIENT); const basicAuth = 'Basic ' + window.btoa(import.meta.env.VITE_OAUTH2_PASSWORD_CLIENT);
Session.set('basicAuth', basicAuth); Session.set('basicAuth', basicAuth);
return request({ return request({
url: '/admin/oauth2/token', url: '/auth/oauth2/token',
method: 'post', method: 'post',
params: data, params: data,
headers: { headers: {
@ -29,7 +29,7 @@ export const loginByMobile = (mobile: any, code: any) => {
Session.set('basicAuth', basicAuth); Session.set('basicAuth', basicAuth);
return request({ return request({
url: '/admin/oauth2/token', url: '/auth/oauth2/token',
headers: { headers: {
isToken: false, isToken: false,
'TENANT-ID': '1', 'TENANT-ID': '1',
@ -47,7 +47,7 @@ export const loginBySocial = (state: string, code: string) => {
Session.set('basicAuth', basicAuth); Session.set('basicAuth', basicAuth);
return request({ return request({
url: '/admin/oauth2/token', url: '/auth/oauth2/token',
headers: { headers: {
isToken: false, isToken: false,
'TENANT-ID': '1', 'TENANT-ID': '1',
@ -60,7 +60,7 @@ export const loginBySocial = (state: string, code: string) => {
export const sendMobileCode = (mobile: any) => { export const sendMobileCode = (mobile: any) => {
return request({ return request({
url: '/admin/mobile/' + mobile, url: '/auth/mobile/' + mobile,
method: 'get', method: 'get',
}); });
}; };
@ -72,7 +72,7 @@ export const refreshTokenApi = (refresh_token: string) => {
const basicAuth = Session.get('basicAuth'); const basicAuth = Session.get('basicAuth');
return request({ return request({
url: '/admin/oauth2/token', url: '/auth/oauth2/token',
headers: { headers: {
isToken: false, isToken: false,
'TENANT-ID': '1', 'TENANT-ID': '1',
@ -90,7 +90,7 @@ export const refreshTokenApi = (refresh_token: string) => {
export const checkToken = (refreshTime: number, refreshLock: boolean) => { export const checkToken = (refreshTime: number, refreshLock: boolean) => {
const basicAuth = Session.get('basicAuth'); const basicAuth = Session.get('basicAuth');
request({ request({
url: '/admin/token/check_token', url: '/auth/token/check_token',
headers: { headers: {
isToken: false, isToken: false,
Authorization: basicAuth, Authorization: basicAuth,
@ -131,7 +131,7 @@ export const checkToken = (refreshTime: number, refreshLock: boolean) => {
*/ */
export const getUserInfo = () => { export const getUserInfo = () => {
return request({ return request({
url: '/admin/user/info', url: '/auth/user/info',
method: 'get', method: 'get',
}); });
}; };

View File

@ -19,7 +19,7 @@ import request from '/@/utils/request';
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/admin/wx-account-fans/page', url: '/mp/wx-account-fans/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -27,7 +27,7 @@ export function fetchList(query) {
export function addObj(obj) { export function addObj(obj) {
return request({ return request({
url: '/admin/wx-account-fans', url: '/mp/wx-account-fans',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -35,28 +35,28 @@ export function addObj(obj) {
export function sync(appId) { export function sync(appId) {
return request({ return request({
url: '/admin/wx-account-fans/sync/' + appId, url: '/mp/wx-account-fans/sync/' + appId,
method: 'post', method: 'post',
}); });
} }
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/wx-account-fans/' + id, url: '/mp/wx-account-fans/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObjs(id) { export function delObjs(id) {
return request({ return request({
url: '/admin/wx-account-fans/' + id, url: '/mp/wx-account-fans/' + id,
method: 'delete', method: 'delete',
}); });
} }
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/wx-account-fans', url: '/mp/wx-account-fans',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -64,7 +64,7 @@ export function putObj(obj) {
export function black(obj, appid) { export function black(obj, appid) {
return request({ return request({
url: '/admin/wx-account-fans/black/' + appid, url: '/mp/wx-account-fans/black/' + appid,
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -72,7 +72,7 @@ export function black(obj, appid) {
export function unblack(obj, appid) { export function unblack(obj, appid) {
return request({ return request({
url: '/admin/wx-account-fans/unblack/' + appid, url: '/mp/wx-account-fans/unblack/' + appid,
method: 'post', method: 'post',
data: obj, data: obj,
}); });

View File

@ -19,7 +19,7 @@ import request from '/@/utils/request';
export function getPage(query) { export function getPage(query) {
return request({ return request({
url: '/admin/wx-account-tag/page', url: '/mp/wx-account-tag/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -27,7 +27,7 @@ export function getPage(query) {
export function addObj(obj) { export function addObj(obj) {
return request({ return request({
url: '/admin/wx-account-tag', url: '/mp/wx-account-tag',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -35,7 +35,7 @@ export function addObj(obj) {
export function delObjs(obj) { export function delObjs(obj) {
return request({ return request({
url: '/admin/wx-account-tag', url: '/mp/wx-account-tag',
method: 'delete', method: 'delete',
data: obj, data: obj,
}); });
@ -43,7 +43,7 @@ export function delObjs(obj) {
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/wx-account-tag', url: '/mp/wx-account-tag',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -51,14 +51,14 @@ export function putObj(obj) {
export function sync(appId) { export function sync(appId) {
return request({ return request({
url: '/admin/wx-account-tag/sync/' + appId, url: '/mp/wx-account-tag/sync/' + appId,
method: 'post', method: 'post',
}); });
} }
export function list(appId) { export function list(appId) {
return request({ return request({
url: '/admin/wx-account-tag/list/', url: '/mp/wx-account-tag/list/',
method: 'get', method: 'get',
params: { wxAccountAppid: appId }, params: { wxAccountAppid: appId },
}); });

View File

@ -19,7 +19,7 @@ import request from '/@/utils/request';
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/admin/wx-account/page', url: '/mp/wx-account/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -27,7 +27,7 @@ export function fetchList(query) {
export function addObj(obj) { export function addObj(obj) {
return request({ return request({
url: '/admin/wx-account', url: '/mp/wx-account',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -35,35 +35,35 @@ export function addObj(obj) {
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/wx-account/' + id, url: '/mp/wx-account/' + id,
method: 'get', method: 'get',
}); });
} }
export function generateQr(appid) { export function generateQr(appid) {
return request({ return request({
url: '/admin/wx-account/qr/' + appid, url: '/mp/wx-account/qr/' + appid,
method: 'post', method: 'post',
}); });
} }
export function clearQuota(appid) { export function clearQuota(appid) {
return request({ return request({
url: '/admin/wx-account/clear-quota/' + appid, url: '/mp/wx-account/clear-quota/' + appid,
method: 'post', method: 'post',
}); });
} }
export function delObjs(id) { export function delObjs(id) {
return request({ return request({
url: '/admin/wx-account/' + id, url: '/mp/wx-account/' + id,
method: 'delete', method: 'delete',
}); });
} }
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/wx-account', url: '/mp/wx-account',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -71,14 +71,14 @@ export function putObj(obj) {
export function fetchAccountList() { export function fetchAccountList() {
return request({ return request({
url: '/admin/wx-account/list', url: '/mp/wx-account/list',
method: 'get', method: 'get',
}); });
} }
export function fetchStatistics(q) { export function fetchStatistics(q) {
return request({ return request({
url: '/admin/wx-account/statistics', url: '/mp/wx-account/statistics',
method: 'get', method: 'get',
params: q, params: q,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function getPage(query) { export function getPage(query) {
return request({ return request({
url: '/admin/wx-auto-reply/page', url: '/mp/wx-auto-reply/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function getPage(query) {
export function addObj(obj) { export function addObj(obj) {
return request({ return request({
url: '/admin/wx-auto-reply', url: '/mp/wx-auto-reply',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,21 +18,21 @@ export function addObj(obj) {
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/wx-auto-reply/' + id, url: '/mp/wx-auto-reply/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(id) { export function delObj(id) {
return request({ return request({
url: '/admin/wx-auto-reply/' + id, url: '/mp/wx-auto-reply/' + id,
method: 'delete', method: 'delete',
}); });
} }
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/wx-auto-reply', url: '/mp/wx-auto-reply',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -19,7 +19,7 @@ import request from '/@/utils/request';
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/admin/wx-fans-msg/page', url: '/mp/wx-fans-msg/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -27,7 +27,7 @@ export function fetchList(query) {
export function addObj(obj) { export function addObj(obj) {
return request({ return request({
url: '/admin/wx-fans-msg', url: '/mp/wx-fans-msg',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -35,21 +35,21 @@ export function addObj(obj) {
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/wxfansmsg/' + id, url: '/mp/wxfansmsg/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObjs(id) { export function delObjs(id) {
return request({ return request({
url: '/admin/wxfansmsg/' + id, url: '/mp/wxfansmsg/' + id,
method: 'delete', method: 'delete',
}); });
} }
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/wxfansmsg', url: '/mp/wxfansmsg',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -57,7 +57,7 @@ export function putObj(obj) {
export function fetchResList(query) { export function fetchResList(query) {
return request({ return request({
url: '/admin/wx-fans-msg/page', url: '/mp/wx-fans-msg/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -65,7 +65,7 @@ export function fetchResList(query) {
export function addResObj(obj) { export function addResObj(obj) {
return request({ return request({
url: '/admin/wx-fans-msg', url: '/mp/wx-fans-msg',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -73,7 +73,7 @@ export function addResObj(obj) {
export function delResObj(id) { export function delResObj(id) {
return request({ return request({
url: '/admin/wx-fans-msg/' + id, url: '/mp/wx-fans-msg/' + id,
method: 'delete', method: 'delete',
}); });
} }

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function getPage(query) { export function getPage(query) {
return request({ return request({
url: '/admin/wx-material/page', url: '/mp/wx-material/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function getPage(query) {
export function addObj(obj) { export function addObj(obj) {
return request({ return request({
url: '/admin/wx-material/materialNews', url: '/mp/wx-material/materialNews',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,7 +18,7 @@ export function addObj(obj) {
export function materialNewsUpdate(obj) { export function materialNewsUpdate(obj) {
return request({ return request({
url: '/admin/wx-material/materialNews', url: '/mp/wx-material/materialNews',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -26,14 +26,14 @@ export function materialNewsUpdate(obj) {
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/wx-material/' + id, url: '/mp/wx-material/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObj(query) { export function delObj(query) {
return request({ return request({
url: '/admin/wx-material', url: '/mp/wx-material',
method: 'delete', method: 'delete',
params: query, params: query,
}); });
@ -41,7 +41,7 @@ export function delObj(query) {
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/wx-material', url: '/mp/wx-material',
method: 'put', method: 'put',
data: obj, data: obj,
}); });
@ -49,7 +49,7 @@ export function putObj(obj) {
export function getMaterialOther(query) { export function getMaterialOther(query) {
return request({ return request({
url: '/admin/wx-material/materialOther', url: '/mp/wx-material/materialOther',
method: 'get', method: 'get',
params: query, params: query,
responseType: 'blob', responseType: 'blob',
@ -58,7 +58,7 @@ export function getMaterialOther(query) {
export function getMaterialVideo(query) { export function getMaterialVideo(query) {
return request({ return request({
url: '/admin/wx-material/materialVideo', url: '/mp/wx-material/materialVideo',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -66,7 +66,7 @@ export function getMaterialVideo(query) {
export function getTempMaterialOther(query) { export function getTempMaterialOther(query) {
return request({ return request({
url: '/admin/wx-material/tempMaterialOther', url: '/mp/wx-material/tempMaterialOther',
method: 'get', method: 'get',
params: query, params: query,
responseType: 'blob', responseType: 'blob',

View File

@ -19,14 +19,14 @@ import request from '/@/utils/request';
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/wx-menu/' + id, url: '/mp/wx-menu/' + id,
method: 'get', method: 'get',
}); });
} }
export function saveObj(appId, data) { export function saveObj(appId, data) {
return request({ return request({
url: '/admin/wx-menu/' + appId, url: '/mp/wx-menu/' + appId,
method: 'post', method: 'post',
data: data, data: data,
}); });
@ -34,7 +34,7 @@ export function saveObj(appId, data) {
export function publishObj(id) { export function publishObj(id) {
return request({ return request({
url: '/admin/wx-menu/' + id, url: '/mp/wx-menu/' + id,
method: 'put', method: 'put',
}); });
} }

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/admin/leave-bill/page', url: '/act/leave-bill/page',
method: 'get', method: 'get',
params: query params: query
}) })
@ -10,7 +10,7 @@ export function fetchList(query) {
export function addObj(obj) { export function addObj(obj) {
return request({ return request({
url: '/admin/leave-bill', url: '/act/leave-bill',
method: 'post', method: 'post',
data: obj data: obj
}) })
@ -18,21 +18,21 @@ export function addObj(obj) {
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/leave-bill/' + id, url: '/act/leave-bill/' + id,
method: 'get' method: 'get'
}) })
} }
export function submit(id) { export function submit(id) {
return request({ return request({
url: '/admin/leave-bill/submit/' + id, url: '/act/leave-bill/submit/' + id,
method: 'get' method: 'get'
}) })
} }
export function delObj(ids?: Object) { export function delObj(ids?: Object) {
return request({ return request({
url: '/admin/leave-bill', url: '/act/leave-bill',
method: 'delete', method: 'delete',
data: ids data: ids
}) })
@ -40,7 +40,7 @@ export function delObj(ids?: Object) {
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/leave-bill/', url: '/act/leave-bill/',
method: 'put', method: 'put',
data: obj data: obj
}) })

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/admin/model', url: '/act/model',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query) {
export function delObj(ids: Object) { export function delObj(ids: Object) {
return request({ return request({
url: '/admin/model', url: '/act/model',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -18,14 +18,14 @@ export function delObj(ids: Object) {
export function deploy(id) { export function deploy(id) {
return request({ return request({
url: '/admin/model/deploy/' + id, url: '/act/model/deploy/' + id,
method: 'post', method: 'post',
}); });
} }
export function addObj(obj?: Object) { export function addObj(obj?: Object) {
return request({ return request({
url: '/admin/model/insert', url: '/act/model/insert',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -33,14 +33,14 @@ export function addObj(obj?: Object) {
export function getObj(id) { export function getObj(id) {
return request({ return request({
url: '/admin/log/' + id, url: '/act/log/' + id,
method: 'get', method: 'get',
}); });
} }
export function putObj(obj) { export function putObj(obj) {
return request({ return request({
url: '/admin/log/', url: '/act/log/',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/admin/process', url: '/act/process',
method: 'get', method: 'get',
params: query params: query
}) })
@ -10,7 +10,7 @@ export function fetchList(query) {
export function delObj(ids?: Object) { export function delObj(ids?: Object) {
return request({ return request({
url: '/admin/process', url: '/act/process',
method: 'delete', method: 'delete',
data: ids data: ids
}) })
@ -18,7 +18,7 @@ export function delObj(ids?: Object) {
export function status(id, type) { export function status(id, type) {
return request({ return request({
url: '/admin/process/status/' + id + '/' + type, url: '/act/process/status/' + id + '/' + type,
method: 'put' method: 'put'
}) })
} }

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query) { export function fetchList(query) {
return request({ return request({
url: '/admin/task/todo', url: '/act/task/todo',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,21 +10,21 @@ export function fetchList(query) {
export function fetchDetail(id) { export function fetchDetail(id) {
return request({ return request({
url: '/admin/task/' + id, url: '/act/task/' + id,
method: 'get', method: 'get',
}); });
} }
export function fetchComment(id) { export function fetchComment(id) {
return request({ return request({
url: '/admin/task/comment/' + id, url: '/act/task/comment/' + id,
method: 'get', method: 'get',
}); });
} }
export function doTask(obj) { export function doTask(obj) {
return request({ return request({
url: '/admin/task', url: '/act/task',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -32,7 +32,7 @@ export function doTask(obj) {
export function delObj(ids?:Object) { export function delObj(ids?:Object) {
return request({ return request({
url: '/admin/task', url: '/act/task',
method: 'delete', method: 'delete',
data: ids data: ids
}) })

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function useBuyApi(amount?: any) { export function useBuyApi(amount?: any) {
return request({ return request({
url: '/admin/goods/merge/buy', url: '/pay/goods/merge/buy',
method: 'get', method: 'get',
params: { amount: amount }, params: { amount: amount },
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query?: Object) { export function fetchList(query?: Object) {
return request({ return request({
url: '/admin/channel/page', url: '/pay/channel/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query?: Object) {
export function addObj(obj?: Object) { export function addObj(obj?: Object) {
return request({ return request({
url: '/admin/channel', url: '/pay/channel',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,14 +18,14 @@ export function addObj(obj?: Object) {
export function getObj(id?: string) { export function getObj(id?: string) {
return request({ return request({
url: '/admin/channel/' + id, url: '/pay/channel/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObjs(ids?: Object) { export function delObjs(ids?: Object) {
return request({ return request({
url: '/admin/channel', url: '/pay/channel',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -33,7 +33,7 @@ export function delObjs(ids?: Object) {
export function putObj(obj?: Object) { export function putObj(obj?: Object) {
return request({ return request({
url: '/admin/channel', url: '/pay/channel',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query?: Object) { export function fetchList(query?: Object) {
return request({ return request({
url: '/admin/goods/page', url: '/pay/goods/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query?: Object) {
export function addObj(obj?: Object) { export function addObj(obj?: Object) {
return request({ return request({
url: '/admin/goods', url: '/pay/goods',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,14 +18,14 @@ export function addObj(obj?: Object) {
export function getObj(id?: string) { export function getObj(id?: string) {
return request({ return request({
url: '/admin/goods/' + id, url: '/pay/goods/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObjs(ids?: Object) { export function delObjs(ids?: Object) {
return request({ return request({
url: '/admin/goods', url: '/pay/goods',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -33,7 +33,7 @@ export function delObjs(ids?: Object) {
export function putObj(obj?: Object) { export function putObj(obj?: Object) {
return request({ return request({
url: '/admin/goods', url: '/pay/goods',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query?: Object) { export function fetchList(query?: Object) {
return request({ return request({
url: '/admin/notify/page', url: '/pay/notify/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query?: Object) {
export function addObj(obj?: Object) { export function addObj(obj?: Object) {
return request({ return request({
url: '/admin/notify', url: '/pay/notify',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,14 +18,14 @@ export function addObj(obj?: Object) {
export function getObj(id?: string) { export function getObj(id?: string) {
return request({ return request({
url: '/admin/notify/' + id, url: '/pay/notify/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObjs(ids?: Object) { export function delObjs(ids?: Object) {
return request({ return request({
url: '/admin/notify', url: '/pay/notify',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -33,7 +33,7 @@ export function delObjs(ids?: Object) {
export function putObj(obj?: Object) { export function putObj(obj?: Object) {
return request({ return request({
url: '/admin/notify', url: '/pay/notify',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query?: Object) { export function fetchList(query?: Object) {
return request({ return request({
url: '/admin/refund/page', url: '/pay/refund/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query?: Object) {
export function useRefundApi(obj?: Object) { export function useRefundApi(obj?: Object) {
return request({ return request({
url: '/admin/refund', url: '/pay/refund',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -25,7 +25,7 @@ export function getObj(id?: string) {
export function delObjs(ids?: Object) { export function delObjs(ids?: Object) {
return request({ return request({
url: '/admin/refund', url: '/pay/refund',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -33,7 +33,7 @@ export function delObjs(ids?: Object) {
export function putObj(obj?: Object) { export function putObj(obj?: Object) {
return request({ return request({
url: '/admin/refund', url: '/pay/refund',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -2,7 +2,7 @@ import request from '/@/utils/request';
export function fetchList(query?: Object) { export function fetchList(query?: Object) {
return request({ return request({
url: '/admin/trade/page', url: '/pay/trade/page',
method: 'get', method: 'get',
params: query, params: query,
}); });
@ -10,7 +10,7 @@ export function fetchList(query?: Object) {
export function addObj(obj?: Object) { export function addObj(obj?: Object) {
return request({ return request({
url: '/admin/trade', url: '/pay/trade',
method: 'post', method: 'post',
data: obj, data: obj,
}); });
@ -18,14 +18,14 @@ export function addObj(obj?: Object) {
export function getObj(id?: string) { export function getObj(id?: string) {
return request({ return request({
url: '/admin/trade/' + id, url: '/pay/trade/' + id,
method: 'get', method: 'get',
}); });
} }
export function delObjs(ids?: Object) { export function delObjs(ids?: Object) {
return request({ return request({
url: '/admin/trade', url: '/pay/trade',
method: 'delete', method: 'delete',
data: ids, data: ids,
}); });
@ -33,7 +33,7 @@ export function delObjs(ids?: Object) {
export function putObj(obj?: Object) { export function putObj(obj?: Object) {
return request({ return request({
url: '/admin/trade', url: '/pay/trade',
method: 'put', method: 'put',
data: obj, data: obj,
}); });

View File

@ -1,134 +1,135 @@
<!-- excel 导入组件 --> <!-- excel 导入组件 -->
<template> <template>
<el-dialog :title="prop.title" v-model="state.upload.open" :close-on-click-modal="false" draggable> <el-dialog :title="prop.title" v-model="state.upload.open" :close-on-click-modal="false" draggable>
<el-upload <el-upload
ref="uploadRef" ref="uploadRef"
:limit="1" :limit="1"
accept=".xlsx, .xls" accept=".xlsx, .xls"
:headers="headers" :headers="headers"
:action="url" :action="other.adaptationUrl(url)"
:disabled="state.upload.isUploading" :disabled="state.upload.isUploading"
:on-progress="handleFileUploadProgress" :on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess" :on-success="handleFileSuccess"
:on-error="handleFileError" :on-error="handleFileError"
:auto-upload="false" :auto-upload="false"
drag drag
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload"></i>
<div class="el-upload__text"> <div class="el-upload__text">
{{ $t('excel.operationNotice') }} {{ $t('excel.operationNotice') }}
<em>{{ $t('excel.clickUpload') }}</em> <em>{{ $t('excel.clickUpload') }}</em>
</div> </div>
<template #tip> <template #tip>
<div class="el-upload__tip text-center"> <div class="el-upload__tip text-center">
<span>{{ $t('excel.fileFormat') }}</span> <span>{{ $t('excel.fileFormat') }}</span>
<el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline" @click="downExcelTemp" v-if="tempUrl" <el-link type="primary" :underline="false" style="font-size: 12px; vertical-align: baseline"
>{{ $t('excel.downloadTemplate') }} @click="downExcelTemp" v-if="tempUrl"
</el-link> >{{ $t('excel.downloadTemplate') }}
</div> </el-link>
</template> </div>
</el-upload> </template>
<template #footer> </el-upload>
<el-button type="primary" @click="submitFileForm">{{ $t('common.confirmButtonText') }}</el-button> <template #footer>
<el-button @click="state.upload.open = false">{{ $t('common.cancelButtonText') }}</el-button> <el-button type="primary" @click="submitFileForm">{{ $t('common.confirmButtonText') }}</el-button>
</template> <el-button @click="state.upload.open = false">{{ $t('common.cancelButtonText') }}</el-button>
</el-dialog> </template>
</el-dialog>
<!--校验失败错误数据--> <!--校验失败错误数据-->
<el-dialog :title="$t('common.validationFailureData')" v-model="state.errorVisible"> <el-dialog :title="$t('common.validationFailureData')" v-model="state.errorVisible">
<el-table :data="state.errorData"> <el-table :data="state.errorData">
<el-table-column property="lineNum" :label="$t('common.lineNumbers')" width="100"></el-table-column> <el-table-column property="lineNum" :label="$t('common.lineNumbers')" width="100"></el-table-column>
<el-table-column property="errors" :label="$t('common.misDescription')" show-overflow-tooltip> <el-table-column property="errors" :label="$t('common.misDescription')" show-overflow-tooltip>
<template v-slot="scope"> <template v-slot="scope">
<el-tag type="danger" v-for="error in scope.row.errors" :key="error">{{ error }} </el-tag> <el-tag type="danger" v-for="error in scope.row.errors" :key="error">{{ error }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-dialog> </el-dialog>
</template> </template>
<script setup lang="ts" name="upload-excel"> <script setup lang="ts" name="upload-excel">
import { useMessage } from '/@/hooks/message'; import {useMessage} from '/@/hooks/message';
import other from '/@/utils/other'; import other from '/@/utils/other';
import { Session } from '/@/utils/storage'; import {Session} from '/@/utils/storage';
const emit = defineEmits(['sizeChange', 'refreshDataList']); const emit = defineEmits(['sizeChange', 'refreshDataList']);
const prop = defineProps({ const prop = defineProps({
url: { url: {
type: String, type: String,
}, },
title: { title: {
type: String, type: String,
}, },
tempUrl: { tempUrl: {
type: String, type: String,
}, },
}); });
const uploadRef = ref(); const uploadRef = ref();
const state = reactive({ const state = reactive({
errorVisible: false, errorVisible: false,
errorData: [], errorData: [],
dialog: { dialog: {
title: '', title: '',
isShowDialog: false, isShowDialog: false,
}, },
upload: { upload: {
open: false, open: false,
isUploading: false, isUploading: false,
}, },
}); });
const downExcelTemp = () => { const downExcelTemp = () => {
other.downBlobFile(prop.tempUrl, {}, 'temp.xlsx'); other.downBlobFile(other.adaptationUrl(prop.tempUrl), {}, 'temp.xlsx');
}; };
const handleFileUploadProgress = () => { const handleFileUploadProgress = () => {
state.upload.isUploading = true; state.upload.isUploading = true;
}; };
const handleFileError = () => { const handleFileError = () => {
useMessage().error('上传失败,数据格式不合法!'); useMessage().error('上传失败,数据格式不合法!');
state.upload.open = false; state.upload.open = false;
}; };
const handleFileSuccess = (response: any) => { const handleFileSuccess = (response: any) => {
state.upload.isUploading = false; state.upload.isUploading = false;
state.upload.open = false; state.upload.open = false;
uploadRef.value.clearFiles(); uploadRef.value.clearFiles();
// //
if (response.code === 1) { if (response.code === 1) {
useMessage().error('导入失败,以下数据不合法'); useMessage().error('导入失败,以下数据不合法');
state.errorVisible = true; state.errorVisible = true;
state.errorData = response.data; state.errorData = response.data;
uploadRef.value.clearFiles(); uploadRef.value.clearFiles();
// //
emit('refreshDataList'); emit('refreshDataList');
} else { } else {
useMessage().success(response.msg ? response.msg : '导入成功'); useMessage().success(response.msg ? response.msg : '导入成功');
// //
emit('refreshDataList'); emit('refreshDataList');
} }
}; };
const submitFileForm = () => { const submitFileForm = () => {
uploadRef.value.submit(); uploadRef.value.submit();
}; };
const show = () => { const show = () => {
state.upload.isUploading = false; state.upload.isUploading = false;
state.upload.open = true; state.upload.open = true;
}; };
const headers = computed(() => { const headers = computed(() => {
return { return {
Authorization: 'Bearer ' + Session.getToken(), Authorization: 'Bearer ' + Session.getToken(),
'TENANT-ID': Session.getTenant(), 'TENANT-ID': Session.getTenant(),
}; };
}); });
// //
defineExpose({ defineExpose({
show, show,
}); });
</script> </script>

View File

@ -5,7 +5,7 @@
<el-upload <el-upload
ref="fileUpload" ref="fileUpload"
class="avatar-uploader" class="avatar-uploader"
:action="props.uploadFileUrl" :action="other.adaptationUrl(props.uploadFileUrl)"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
@ -26,6 +26,7 @@
import { useMessage } from '/@/hooks/message'; import { useMessage } from '/@/hooks/message';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
import { watch } from 'vue'; import { watch } from 'vue';
import other from "/@/utils/other";
const imageUrl = ref(''); const imageUrl = ref('');
const fileUpload = ref(); const fileUpload = ref();

View File

@ -4,7 +4,7 @@
<el-upload <el-upload
ref="fileUpload" ref="fileUpload"
v-if="props.type === 'default'" v-if="props.type === 'default'"
:action="props.uploadFileUrl" :action="other.adaptationUrl(props.uploadFileUrl)"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
:file-list="fileList" :file-list="fileList"
:headers="headers" :headers="headers"
@ -39,7 +39,7 @@
<el-upload <el-upload
ref="fileUpload" ref="fileUpload"
v-if="props.type === 'simple'" v-if="props.type === 'simple'"
:action="props.uploadFileUrl" :action="other.adaptationUrl(props.uploadFileUrl)"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
:file-list="fileList" :file-list="fileList"
:headers="headers" :headers="headers"
@ -60,6 +60,7 @@
<script setup lang="ts" name="upload-file"> <script setup lang="ts" name="upload-file">
import { useMessage } from '/@/hooks/message'; import { useMessage } from '/@/hooks/message';
import { Local, Session } from '/@/utils/storage'; import { Local, Session } from '/@/utils/storage';
import other from "/@/utils/other";
const props = defineProps({ const props = defineProps({
modelValue: [String, Array], modelValue: [String, Array],
// //

View File

@ -12,6 +12,7 @@ import request from '/@/utils/request';
import { useMessage } from '/@/hooks/message'; import { useMessage } from '/@/hooks/message';
// @ts-ignore // @ts-ignore
import * as CryptoJS from 'crypto-js'; import * as CryptoJS from 'crypto-js';
import { validateNull } from './validate';
// 引入组件 // 引入组件
const SvgIcon = defineAsyncComponent(() => import('/@/components/svgIcon/index.vue')); const SvgIcon = defineAsyncComponent(() => import('/@/components/svgIcon/index.vue'));
@ -335,6 +336,9 @@ const other = {
getQueryString: (url: string, paraName: string) => { getQueryString: (url: string, paraName: string) => {
return getQueryString(url, paraName); return getQueryString(url, paraName);
}, },
adaptationUrl: (url?: string) => {
return adaptationUrl(url);
},
}; };
export function getQueryString(url: string, paraName: string) { export function getQueryString(url: string, paraName: string) {
@ -401,5 +405,27 @@ export function toUnderline(str: string) {
return str.replace(/([A-Z])/g, '_$1').toLowerCase(); 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; export default other;

View File

@ -1,7 +1,8 @@
import axios, { AxiosInstance, InternalAxiosRequestConfig } from 'axios'; import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';
import { Session, Local } from '/@/utils/storage'; import { Session, Local } from '/@/utils/storage';
import { useMessageBox } from '/@/hooks/message';
import qs from 'qs'; import qs from 'qs';
import { useMessageBox } from '../hooks/message'; import other from './other';
// 配置新建一个 axios 实例 // 配置新建一个 axios 实例
const service: AxiosInstance = axios.create({ const service: AxiosInstance = axios.create({
@ -17,7 +18,7 @@ const service: AxiosInstance = axios.create({
// 添加请求拦截器 // 添加请求拦截器
service.interceptors.request.use( service.interceptors.request.use(
(config: InternalAxiosRequestConfig) => { (config: AxiosRequestConfig) => {
// get查询参数序列化 // get查询参数序列化
if (config.method === 'get') { if (config.method === 'get') {
// @ts-ignore // @ts-ignore
@ -37,6 +38,8 @@ service.interceptors.request.use(
config.headers!['TENANT-ID'] = Local.get('tenantId'); config.headers!['TENANT-ID'] = Local.get('tenantId');
} }
//自动适配单体、微服务架构不同的URL
config.url = other.adaptationUrl(config.url);
return config; return config;
}, },
(error) => { (error) => {

View File

@ -125,7 +125,7 @@ const handleSelectionChange = (objs: any) => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/approle/export', state.queryForm, 'approle.xlsx'); downBlobFile('/app/approle/export', state.queryForm, 'approle.xlsx');
}; };
// //

View File

@ -145,7 +145,7 @@
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/appsocial/export', state.queryForm, 'appsocial.xlsx'); downBlobFile('/app/appsocial/export', state.queryForm, 'appsocial.xlsx');
}; };
// //

View File

@ -146,7 +146,7 @@ const handleSelectionChange = (objs: any) => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/appuser/export', state.queryForm, 'users.xlsx'); downBlobFile('/app/appuser/export', state.queryForm, 'users.xlsx');
}; };
// //

View File

@ -187,7 +187,7 @@
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/sys-job/export', state.queryForm, 'job.xlsx'); downBlobFile('/daemon/sys-job/export', state.queryForm, 'job.xlsx');
}; };
const handleJobLog = (row: any) => { const handleJobLog = (row: any) => {

View File

@ -131,7 +131,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/schedule/export', state.queryForm, 'schedule.xlsx'); downBlobFile('/daemon/schedule/export', state.queryForm, 'schedule.xlsx');
}; };
// //

View File

@ -172,7 +172,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/fans/export', state.queryForm, 'fans.xlsx'); downBlobFile('/mp/fans/export', state.queryForm, 'fans.xlsx');
}; };
// //

View File

@ -148,7 +148,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/wxAccountTag/export', state.queryForm, 'wxAccountTag.xlsx'); downBlobFile('/mp/wxAccountTag/export', state.queryForm, 'wxAccountTag.xlsx');
}; };
// //

View File

@ -134,7 +134,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/account/export', state.queryForm, 'account.xlsx'); downBlobFile('/mp/account/export', state.queryForm, 'account.xlsx');
}; };
// //

View File

@ -180,7 +180,7 @@ onMounted(() => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/wxFansMsg/export', state.queryForm, 'wxFansMsg.xlsx'); downBlobFile('/act/wxFansMsg/export', state.queryForm, 'wxFansMsg.xlsx');
}; };
// //

View File

@ -129,7 +129,7 @@
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/leave-bill/export', state.queryForm, 'leave.xlsx') downBlobFile('/act/leave-bill/export', state.queryForm, 'leave.xlsx')
} }
// //

View File

@ -107,7 +107,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/task/export', state.queryForm, 'task.xlsx'); downBlobFile('/act/task/export', state.queryForm, 'task.xlsx');
}; };
// //

View File

@ -130,7 +130,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/channel/export', state.queryForm, 'channel.xlsx'); downBlobFile('/pay/channel/export', state.queryForm, 'channel.xlsx');
}; };
// //

View File

@ -131,7 +131,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/goods/export', state.queryForm, 'order.xlsx'); downBlobFile('/pay/goods/export', state.queryForm, 'order.xlsx');
}; };
// //

View File

@ -102,7 +102,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/notify/export', state.queryForm, 'record.xlsx'); downBlobFile('/pay/notify/export', state.queryForm, 'record.xlsx');
}; };
// //

View File

@ -108,7 +108,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/refund/export', state.queryForm, 'refund.xlsx'); downBlobFile('/pay/refund/export', state.queryForm, 'refund.xlsx');
}; };
// //

View File

@ -153,7 +153,7 @@ const resetQuery = () => {
// excel // excel
const exportExcel = () => { const exportExcel = () => {
downBlobFile('/admin/trade/export', state.queryForm, 'trade.xlsx'); downBlobFile('/pay/trade/export', state.queryForm, 'trade.xlsx');
}; };
// //