Skip to content

Commit

Permalink
request prefix add base path
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteshader committed Sep 26, 2022
1 parent a56c748 commit 4963243
Show file tree
Hide file tree
Showing 27 changed files with 135 additions and 129 deletions.
4 changes: 3 additions & 1 deletion react-ui/config/defaultSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const Settings: LayoutSettings & {
pwa?: boolean;
logo?: string;
tabsLayout?: boolean;
apiBasePath?: string;
} = {
navTheme: 'light',
headerTheme: 'light',
Expand All @@ -18,7 +19,8 @@ const Settings: LayoutSettings & {
pwa: false,
logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
iconfontUrl: '',
tabsLayout: true,
tabsLayout: true,
apiBasePath: '/api',
};

export default Settings;
2 changes: 1 addition & 1 deletion react-ui/src/pages/monitor/cache/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import request from '@/utils/request';

// 获取服务器信息
export async function getCacheInfo() {
return request('/api/monitor/cache', {
return request('/monitor/cache', {
method: 'GET',
});
}
12 changes: 6 additions & 6 deletions react-ui/src/pages/monitor/cacheList/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,42 +11,42 @@ import request from '@/utils/request';

// 查询缓存名称列表
export function listCacheName() {
return request('/api/monitor/cache/getNames', {
return request('/monitor/cache/getNames', {
method: 'get'
})
}

// 查询缓存键名列表
export function listCacheKey(cacheName: string) {
return request('/api/monitor/cache/getKeys/' + cacheName, {
return request('/monitor/cache/getKeys/' + cacheName, {
method: 'get'
})
}

// 查询缓存内容
export function getCacheValue(cacheName: string, cacheKey: string) {
return request('/api/monitor/cache/getValue/' + cacheName + '/' + cacheKey, {
return request('/monitor/cache/getValue/' + cacheName + '/' + cacheKey, {
method: 'get'
})
}

// 清理指定名称缓存
export function clearCacheName(cacheName: string) {
return request('/api/monitor/cache/clearCacheName/' + cacheName, {
return request('/monitor/cache/clearCacheName/' + cacheName, {
method: 'delete'
})
}

// 清理指定键名缓存
export function clearCacheKey(cacheKey: string) {
return request('/api/monitor/cache/clearCacheKey/' + cacheKey, {
return request('/monitor/cache/clearCacheKey/' + cacheKey, {
method: 'delete'
})
}

// 清理全部缓存
export function clearCacheAll() {
return request('/api/monitor/cache/clearCacheAll', {
return request('/monitor/cache/clearCacheAll', {
method: 'delete'
})
}
3 changes: 2 additions & 1 deletion react-ui/src/pages/monitor/druid/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect } from 'react';
import defaultSettings from '../../../../config/defaultSettings';

/* *
*
Expand All @@ -24,7 +25,7 @@ const DruidInfo: React.FC = () => {
style={{ width: '100%', border: '0px', height: '100%' }}
// frameborder={'0'}
scrolling="yes"
src={'/api/druid/login.html'}
src={`${defaultSettings.apiBasePath}/druid/login.html`}
id="bdIframe"
></iframe>
// </WrapContent>
Expand Down
14 changes: 7 additions & 7 deletions react-ui/src/pages/monitor/job/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { JobType, JobListParams } from './data.d';
// 查询定时任务调度列表
export async function getJobList(params?: JobListParams) {
const queryString = new URLSearchParams(params).toString();
return request(`/api/monitor/job/list?${queryString}`, {
return request(`/monitor/job/list?${queryString}`, {
data: params,
method: 'GET',
headers: {
Expand All @@ -24,30 +24,30 @@ export async function getJobList(params?: JobListParams) {

// 查询定时任务调度详细
export function getJob(jobId: number) {
return request(`/api/monitor/job/${jobId}`, {
return request(`/monitor/job/${jobId}`, {
method: 'GET',
});
}

// 新增定时任务调度
export async function addJob(params: JobType) {
return request('/api/monitor/job', {
return request('/monitor/job', {
method: 'POST',
data: params,
});
}

// 修改定时任务调度
export async function updateJob(params: JobType) {
return request('/api/monitor/job', {
return request('/monitor/job', {
method: 'PUT',
data: params,
});
}

// 删除定时任务调度
export async function removeJob(ids: string) {
return request(`/api/monitor/job/${ids}`, {
return request(`/monitor/job/${ids}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
Expand All @@ -57,7 +57,7 @@ export async function removeJob(ids: string) {

// 导出定时任务调度
export function exportJob(params?: JobListParams) {
return downLoadXlsx(`/api/monitor/job/export`, { params }, `job_${new Date().getTime()}.xlsx`);
return downLoadXlsx(`/monitor/job/export`, { params }, `job_${new Date().getTime()}.xlsx`);
}

// 定时任务立即执行一次
Expand All @@ -66,7 +66,7 @@ export async function runJob(jobId: number, jobGroup: string) {
jobId,
jobGroup,
};
return request('/api/monitor/job/run', {
return request('/monitor/job/run', {
method: 'PUT',
data: job,
});
Expand Down
14 changes: 7 additions & 7 deletions react-ui/src/pages/monitor/joblog/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { JobLogType, JobLogListParams } from './data.d';
// 查询定时任务调度日志列表
export async function getJobLogList(params?: JobLogListParams) {
const queryString = new URLSearchParams(params).toString();
return request(`/api/monitor/jobLog/list?${queryString}`, {
return request(`/monitor/jobLog/list?${queryString}`, {
data: params,
method: 'GET',
headers: {
Expand All @@ -25,30 +25,30 @@ export async function getJobLogList(params?: JobLogListParams) {

// 查询定时任务调度日志详细
export function getJobLog(jobJobLogId: number) {
return request(`/api/monitor/jobLog/${jobJobLogId}`, {
return request(`/monitor/jobLog/${jobJobLogId}`, {
method: 'GET',
});
}

// 新增定时任务调度日志
export async function addJobLog(params: JobLogType) {
return request('/api/monitor/jobLog', {
return request('/monitor/jobLog', {
method: 'POST',
data: params,
});
}

// 修改定时任务调度日志
export async function updateJobLog(params: JobLogType) {
return request('/api/monitor/jobLog', {
return request('/monitor/jobLog', {
method: 'PUT',
data: params,
});
}

// 删除定时任务调度日志
export async function removeJobLog(ids: string) {
return request(`/api/monitor/jobLog/${ids}`, {
return request(`/monitor/jobLog/${ids}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
Expand All @@ -58,12 +58,12 @@ export async function removeJobLog(ids: string) {

// 导出定时任务调度日志
export function exportJobLog(params?: JobLogListParams) {
return downLoadXlsx(`/api/monitor/jobLog/export`, { params }, `job_log_${new Date().getTime()}.xlsx`);
return downLoadXlsx(`/monitor/jobLog/export`, { params }, `job_log_${new Date().getTime()}.xlsx`);
}

// 清空调度日志
export function cleanJobLog() {
return request('/api/monitor/jobLog/clean', {
return request('/monitor/jobLog/clean', {
method: 'DELETE',
});
}
14 changes: 7 additions & 7 deletions react-ui/src/pages/monitor/logininfor/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { LogininforType, LogininforListParams } from './data.d';
// 查询系统访问记录列表
export async function getLogininforList(params?: LogininforListParams) {
const queryString = new URLSearchParams(params).toString();
return request(`/api/monitor/logininfor/list?${queryString}`, {
return request(`/monitor/logininfor/list?${queryString}`, {
data: params,
method: 'GET',
headers: {
Expand All @@ -25,30 +25,30 @@ export async function getLogininforList(params?: LogininforListParams) {

// 查询系统访问记录详细
export function getLogininfor(infoId: number) {
return request(`/api/monitor/logininfor/${infoId}`, {
return request(`/monitor/logininfor/${infoId}`, {
method: 'GET',
});
}

// 新增系统访问记录
export async function addLogininfor(params: LogininforType) {
return request('/api/monitor/logininfor', {
return request('/monitor/logininfor', {
method: 'POST',
data: params,
});
}

// 修改系统访问记录
export async function updateLogininfor(params: LogininforType) {
return request('/api/monitor/logininfor', {
return request('/monitor/logininfor', {
method: 'PUT',
data: params,
});
}

// 删除系统访问记录
export async function removeLogininfor(ids: string) {
return request(`/api/monitor/logininfor/${ids}`, {
return request(`/monitor/logininfor/${ids}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
Expand All @@ -58,12 +58,12 @@ export async function removeLogininfor(ids: string) {

// 导出系统访问记录
export function exportLogininfor(params?: LogininforListParams) {
return downLoadXlsx(`/api/monitor/logininfor/export`, { params }, `login_infor_${new Date().getTime()}.xlsx`);
return downLoadXlsx(`/monitor/logininfor/export`, { params }, `login_infor_${new Date().getTime()}.xlsx`);
}

// 清空登录日志
export async function cleanLogininfor() {
return request('/api/monitor/logininfor/clean', {
return request('/monitor/logininfor/clean', {
method: 'DELETE',
});
}
4 changes: 2 additions & 2 deletions react-ui/src/pages/monitor/online/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import type { OnlineUserListParams } from './data.d';
// 查询在线用户列表
export async function getOnlineUserList(params?: OnlineUserListParams) {
const queryString = new URLSearchParams(params).toString();
return request(`/api/monitor/online/list?${queryString}`, {
return request(`/monitor/online/list?${queryString}`, {
data: params,
method: 'GET',
});
}

// 强退用户
export async function forceLogout(tokenId: string) {
return request(`/api/monitor/online/${tokenId}`, {
return request(`/monitor/online/${tokenId}`, {
method: 'DELETE',
});
}
14 changes: 7 additions & 7 deletions react-ui/src/pages/monitor/operlog/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { OperlogType, OperlogListParams } from './data.d';
// 查询操作日志记录列表
export async function getOperlogList(params?: OperlogListParams) {
const queryString = new URLSearchParams(params).toString();
return request(`/api/monitor/operlog/list?${queryString}`, {
return request(`/monitor/operlog/list?${queryString}`, {
data: params,
method: 'GET',
headers: {
Expand All @@ -24,30 +24,30 @@ export async function getOperlogList(params?: OperlogListParams) {

// 查询操作日志记录详细
export function getOperlog(operId: number) {
return request(`/api/monitor/operlog/${operId}`, {
return request(`/monitor/operlog/${operId}`, {
method: 'GET',
});
}

// 新增操作日志记录
export async function addOperlog(params: OperlogType) {
return request('/api/monitor/operlog', {
return request('/monitor/operlog', {
method: 'POST',
data: params,
});
}

// 修改操作日志记录
export async function updateOperlog(params: OperlogType) {
return request('/api/monitor/operlog', {
return request('/monitor/operlog', {
method: 'PUT',
data: params,
});
}

// 删除操作日志记录
export async function removeOperlog(ids: string) {
return request(`/api/monitor/operlog/${ids}`, {
return request(`/monitor/operlog/${ids}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
Expand All @@ -57,12 +57,12 @@ export async function removeOperlog(ids: string) {

// 导出操作日志记录
export function exportOperlog(params?: OperlogListParams) {
return downLoadXlsx(`/api/monitor/operlog/export`, { params }, `oper_log_${new Date().getTime()}.xlsx`);
return downLoadXlsx(`/monitor/operlog/export`, { params }, `oper_log_${new Date().getTime()}.xlsx`);
}

// 清空操作日志
export async function cleanOperlog() {
return request('/api/monitor/operlog/clean', {
return request('/monitor/operlog/clean', {
method: 'DELETE',
});
}
2 changes: 1 addition & 1 deletion react-ui/src/pages/monitor/server/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import request from '@/utils/request';

// 获取服务器信息
export async function getServerInfo() {
return request('/api/monitor/server', {
return request('/monitor/server', {
method: 'GET',
});
}
Loading

0 comments on commit 4963243

Please sign in to comment.