fix: 修复创建定时任务保存workspaceId和projectId的问题 (#4765)
* fix: 修复创建定时任务保存workspaceId和projectId的问题 * fix: 修复创建定时任务保存workspaceId和projectId的问题 Co-authored-by: Captain.B <bin@fit2cloud.com>
This commit is contained in:
parent
53a8890ed7
commit
883ce335c3
|
@ -71,7 +71,7 @@ import SwaggerTaskList from "@/business/components/api/definition/components/imp
|
|||
import CrontabResult from "@/business/components/common/cron/CrontabResult";
|
||||
import Crontab from "@/business/components/common/cron/Crontab";
|
||||
import {cronValidate} from "@/common/js/cron";
|
||||
import {getCurrentProjectID, getCurrentUser} from "@/common/js/utils";
|
||||
import {getCurrentProjectID, getCurrentUser, getCurrentWorkspaceId} from "@/common/js/utils";
|
||||
import SelectTree from "@/business/components/common/select-tree/SelectTree";
|
||||
export default {
|
||||
name: "ApiSchedule",
|
||||
|
@ -184,6 +184,7 @@ export default {
|
|||
},
|
||||
saveSchedule() {
|
||||
this.formData.projectId = getCurrentProjectID();
|
||||
this.formData.workspaceId = getCurrentWorkspaceId();
|
||||
this.formData.value = this.formData.rule;
|
||||
let url = '';
|
||||
if (this.formData.id) {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
<script>
|
||||
import {
|
||||
getCurrentProjectID,
|
||||
getCurrentUser,
|
||||
getCurrentUser, getCurrentWorkspaceId,
|
||||
listenGoBack,
|
||||
removeGoBackListener
|
||||
} from "@/common/js/utils";
|
||||
|
@ -175,6 +175,7 @@ export default {
|
|||
param = this.schedule;
|
||||
param.resourceId = this.swaggerUrl;
|
||||
param.projectId = getCurrentProjectID();
|
||||
param.workspaceId = getCurrentWorkspaceId();
|
||||
param.moduleId = this.moduleId;
|
||||
param.modulePath = this.modulePath;
|
||||
param.modeId = this.modeId;
|
||||
|
|
|
@ -77,7 +77,7 @@ import MsApiScenarioConfig from "./components/ApiScenarioConfig";
|
|||
import {Scenario, Test} from "./model/ScenarioModel"
|
||||
import MsApiReportStatus from "../report/ApiReportStatus";
|
||||
import MsApiReportDialog from "./ApiReportDialog";
|
||||
import {downloadFile, getCurrentProjectID, getUUID} from "@/common/js/utils";
|
||||
import {downloadFile, getCurrentProjectID, getCurrentWorkspaceId, getUUID} from "@/common/js/utils";
|
||||
import MsScheduleConfig from "../../common/components/MsScheduleConfig";
|
||||
import ApiImport from "./components/import/ApiImport";
|
||||
import MsContainer from "@/business/components/common/components/MsContainer";
|
||||
|
@ -330,6 +330,13 @@ export default {
|
|||
let param = {};
|
||||
param = this.test.schedule;
|
||||
param.resourceId = this.test.id;
|
||||
// 兼容问题,数据库里有的projectId为空
|
||||
if (!param.projectId) {
|
||||
param.projectId = getCurrentProjectID();
|
||||
}
|
||||
if (!param.workspaceId) {
|
||||
param.workspaceId = getCurrentWorkspaceId();
|
||||
}
|
||||
let url = '/api/schedule/create';
|
||||
if (param.id) {
|
||||
url = '/api/schedule/update';
|
||||
|
|
Loading…
Reference in New Issue