update:本地应用启动插件接口返回更新

This commit is contained in:
2026-01-22 13:46:43 +08:00
parent 8cb3d7749f
commit 51e5e11d42
5 changed files with 39 additions and 26 deletions

View File

@@ -1,21 +1,23 @@
import { downloadFileByStream } from '@/utils/file';
// import { get, post } from './index';
import { get, post } from './index';
import { ElNotification, ElButton } from 'element-plus';
import { h } from 'vue';
import { get, post } from '@/api/request';
// import { get, post } from '@/api/request';
const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_APPLICATION;
// const env = import.meta.env;
// const PREFIX = env.VITE_API_PREFIX_APPLICATION;
// 获取电脑机器码
export const getdeviceuuidApi = async () => {
const res = await get(`${PREFIX}getdeviceuuid`);
// const res = await get(`${PREFIX}getdeviceuuid`);
const res = await get('/getdeviceuuid');
return res;
};
// 启动应用
export const execApi = async (params: any) => {
const res = await get(`${PREFIX}exec`, params);
// const res = await get(`${PREFIX}exec`, params);
const res = await get('/exec', params);
return res;
};
@@ -25,7 +27,8 @@ export const execApi = async (params: any) => {
* @returns
*/
export const checklocalresourceApi = async (params: any) => {
const res = await post(`${PREFIX}checklocalresource`, params);
// const res = await post(`${PREFIX}checklocalresource`, params);
const res = await post('/checklocalresource', params);
return res;
};
@@ -37,7 +40,8 @@ export const checklocalresourceApi = async (params: any) => {
* @returns
*/
export const submittaskApi = async (params: any) => {
const res = await post(`${PREFIX}submittask`, params);
// const res = await post(`${PREFIX}submittask`, params);
const res = await post('/submittask', params);
return res;
};
@@ -47,7 +51,8 @@ export const submittaskApi = async (params: any) => {
* @returns
*/
export const canceltaskApi = async (params: any) => {
const res = await get(`${PREFIX}canceltask`, params);
// const res = await get(`${PREFIX}canceltask`, params);
const res = await get('/canceltask', params);
return res;
};
@@ -57,7 +62,8 @@ export const canceltaskApi = async (params: any) => {
* @returns
*/
export const querytasklogApi = async (params: any) => {
const res = await get(`${PREFIX}querytasklog`, params);
// const res = await get(`${PREFIX}querytasklog`, params);
const res = await get('/querytasklog', params);
return res;
};

View File

@@ -289,8 +289,8 @@ const getImgPathFun = (fileId: any) => {
const getdeviceuuidFun = async () => {
try {
const res: any = await getdeviceuuidApi();
if (res) {
const uuid = res
if (res && res.code === 200) {
const uuid = res.data.returnCode
.replace('UUID', '')
.replace(/\ +/g, '')
.replace(/[\r\n]/g, '');
@@ -322,12 +322,12 @@ const startAppFun = async (data: any) => {
const uuid = localStorage.getItem('USER_UUID');
if (uuid) {
const res = await execApi({
const res: any = await execApi({
path: data.appPath,
param: '',
});
if (res) {
if (res && res.code === 200) {
ElMessage.success('应用正在启动中,请等待');
const res2: any = await addApplicationCallRecordApi({
appName: data.appName,

View File

@@ -252,8 +252,8 @@ const getTypeAppData = async (type: any, machineCode: any, user: any) => {
const getdeviceuuidFun = async () => {
try {
const res: any = await getdeviceuuidApi();
if (res) {
const uuid = res
if (res && res.code === 200) {
const uuid = res.data.returnCode
.replace('UUID', '')
.replace(/\ +/g, '')
.replace(/[\r\n]/g, '');
@@ -275,12 +275,12 @@ const startAppFun = async (data: any) => {
const uuid = localStorage.getItem('USER_UUID');
if (uuid) {
const res = await execApi({
const res: any = await execApi({
path: data.appPath,
param: '',
});
if (res) {
if (res && res.code === 200) {
const res2: any = await addApplicationCallRecordApi({
appName: data.appName,
appType: data.appType,

View File

@@ -151,6 +151,7 @@ import dayjs from 'dayjs';
import taskPerformance from '@/components/taskDetail/taskPerformance.vue';
import { generateReportApi, listSimulationKeyResultApi } from '@/api/project/run';
import { getUserData } from '@/utils/user';
import { cloneDeep } from 'lodash-es';
const env = import.meta.env;
@@ -262,7 +263,7 @@ const createSuccessFun = async () => {
const imageFileIdList = chcekImgs.map((item: any) => {
return item.fileId;
});
const taskInfo = props.parentNodeInfo;
const taskInfo = cloneDeep(props.parentNodeInfo);
for (const key in taskInfo) {
if (key.includes('tag')) {
delete taskInfo[key];
@@ -313,7 +314,7 @@ watch(
() => props.currentNodeInfo,
(newVal) => {
if (newVal) {
const runInfo = newVal;
const runInfo = cloneDeep(newVal);
const projectInfo = JSON.parse(
localStorage.getItem('CURRENT_FILTER_RUN_TASK_TREE_PARAM') as string
);

View File

@@ -652,7 +652,7 @@ const startLocalAppFun = async () => {
if (result) {
const params = await getSubmitParamFun();
const res: any = await submittaskApi(params);
if (res) {
if (res && res.code === 200) {
const res2: any = await addApplicationCallRecordApi({
appName: flowNodeParamData.value.label,
appType: flowNodeParamData.value.nodeTypeValue,
@@ -811,17 +811,23 @@ const getfileTypeList = async () => {
const checklocalresourceFun = async (path: any) => {
try {
const res: any = await checklocalresourceApi({ resource: [path] });
if (res) {
return res;
if (res && res.code === 200) {
if (res.data.returnCode.includes('Operate Success')) {
return true;
} else {
return false;
}
}
} catch {}
} catch {
return false;
}
};
const getdeviceuuidFun = async () => {
try {
const res: any = await getdeviceuuidApi();
if (res) {
const uuid = res
if (res && res.code === 200) {
const uuid = res.data.returnCode
.replace('UUID', '')
.replace(/\ +/g, '')
.replace(/[\r\n]/g, '');