feat(fix) 修复配置二级路径无法下载日志相关问题

This commit is contained in:
bwcx_jzy 2022-03-10 11:52:16 +08:00
parent 0bd596983b
commit a19fbd746e
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
5 changed files with 13 additions and 4 deletions

View File

@ -9,6 +9,7 @@
1. 【server】修复工作空间非隐私变量不切换无法创建问题
2. 【server】修复无法删除工作空间变量
3. 【server】修复编辑构建数据回显错乱情况感谢@tan90°
4. 【server】修复配置二级路径无法下载日志相关问题感谢@hu向...🤡)
------

View File

@ -1,4 +1,5 @@
import axios from "./config";
import { loadRouterBase } from "./config";
/**
* 备份列表
@ -75,7 +76,7 @@ export function restoreBackup(id) {
* @returns
*/
export function downloadBackupFile(id) {
return `/system/backup/download?id=${id}`;
return `${loadRouterBase("/system/backup/download")}?id=${id}`;
}
/**

View File

@ -1,4 +1,5 @@
import axios from "./config";
import { loadRouterBase } from "./config";
/**
* 构建列表
@ -207,7 +208,7 @@ export function geteBuildHistory(params) {
* @param {*} logId
*/
export function downloadBuildLog(logId) {
return `/build/history/download_log.html?logId=${logId}`;
return `${loadRouterBase("/build/history/download_log.html")}?logId=${logId}`;
}
/**
@ -215,7 +216,7 @@ export function downloadBuildLog(logId) {
* @param {*} logId
*/
export function downloadBuildFile(logId) {
return `/build/history/download_file.html?logId=${logId}`;
return `${loadRouterBase("/build/history/download_file.html")}?logId=${logId}`;
}
/**

View File

@ -1,4 +1,5 @@
import axios from "./config";
import { loadRouterBase } from "./config";
// 命令列表
export function getCommandList(params) {
@ -83,7 +84,7 @@ export function getCommandLogInfo(params) {
* @param {*} logId
*/
export function downloadLog(logId) {
return `/node/ssh_command_log/download_log?logId=${logId}`;
return `${loadRouterBase("/node/ssh_command_log/download_log")}?logId=${logId}`;
}
export const statusMap = {

View File

@ -208,3 +208,8 @@ function redoRequest(config) {
}
export default request;
//
export function loadRouterBase(url) {
return `${((window.routerBase || "") + url).replace(new RegExp("//", "gm"), "/")}`;
}