fix: 修复创建定时任务保存workspaceId和projectId的问题 (#4765)

* fix: 修复创建定时任务保存workspaceId和projectId的问题

* fix: 修复创建定时任务保存workspaceId和projectId的问题

Co-authored-by: Captain.B <bin@fit2cloud.com>
This commit is contained in:
metersphere-bot 2021-07-16 16:38:07 +08:00 committed by GitHub
parent 53a8890ed7
commit 883ce335c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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';