mirror of
https://gitee.com/JavaLionLi/plus-ui.git
synced 2026-09-14 16:17:31 +08:00
fix 修复 前端输入性CVE漏洞 禁止使用代码生成到本地路径
This commit is contained in:
parent
2a6c440593
commit
10cd746f52
@ -61,14 +61,6 @@ export const delTable = (tableId: string | number | Array<string | number>) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 生成代码(自定义路径)
|
|
||||||
export const genCode = (tableId: string | number) => {
|
|
||||||
return request({
|
|
||||||
url: '/tool/gen/genCode/' + tableId,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 同步数据库
|
// 同步数据库
|
||||||
export const synchDb = (tableId: string | number) => {
|
export const synchDb = (tableId: string | number) => {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -13,8 +13,6 @@ export interface TableVO extends BaseEntity {
|
|||||||
businessName: string;
|
businessName: string;
|
||||||
functionName: string;
|
functionName: string;
|
||||||
functionAuthor: string;
|
functionAuthor: string;
|
||||||
genType: string;
|
|
||||||
genPath: string;
|
|
||||||
pkColumn?: any;
|
pkColumn?: any;
|
||||||
columns?: any;
|
columns?: any;
|
||||||
options?: any;
|
options?: any;
|
||||||
@ -81,8 +79,6 @@ export interface DbTableVO {
|
|||||||
businessName?: any;
|
businessName?: any;
|
||||||
functionName?: any;
|
functionName?: any;
|
||||||
functionAuthor?: any;
|
functionAuthor?: any;
|
||||||
genType?: any;
|
|
||||||
genPath?: any;
|
|
||||||
pkColumn?: any;
|
pkColumn?: any;
|
||||||
columns: DbColumnVO[];
|
columns: DbColumnVO[];
|
||||||
options?: any;
|
options?: any;
|
||||||
@ -162,8 +158,6 @@ export interface DbTableForm extends BaseEntity {
|
|||||||
businessName: string;
|
businessName: string;
|
||||||
functionName: string;
|
functionName: string;
|
||||||
functionAuthor: string;
|
functionAuthor: string;
|
||||||
genType: string;
|
|
||||||
genPath: string;
|
|
||||||
pkColumn?: any;
|
pkColumn?: any;
|
||||||
columns: DbColumnForm[];
|
columns: DbColumnForm[];
|
||||||
options: string;
|
options: string;
|
||||||
|
|||||||
@ -82,44 +82,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item prop="genType">
|
|
||||||
<template #label>
|
|
||||||
生成代码方式
|
|
||||||
<el-tooltip content="默认为zip压缩包下载,也可以自定义生成路径" placement="top">
|
|
||||||
<el-icon><question-filled /></el-icon>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
<el-radio v-model="infoForm.genType" value="0">zip压缩包</el-radio>
|
|
||||||
<el-radio v-model="infoForm.genType" value="1">自定义路径</el-radio>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col v-if="infoForm.genType == '1'" :span="24">
|
|
||||||
<el-form-item prop="genPath">
|
|
||||||
<template #label>
|
|
||||||
自定义路径
|
|
||||||
<el-tooltip content="填写磁盘绝对路径,若不填写,则生成到当前Web项目下" placement="top">
|
|
||||||
<el-icon><question-filled /></el-icon>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
|
||||||
<el-input v-model="infoForm.genPath">
|
|
||||||
<template #append>
|
|
||||||
<el-dropdown>
|
|
||||||
<el-button type="primary">
|
|
||||||
最近路径快速选择
|
|
||||||
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
||||||
</el-button>
|
|
||||||
<template #dropdown>
|
|
||||||
<el-dropdown-menu>
|
|
||||||
<el-dropdown-item @click="infoForm.genPath = '/'">恢复默认的生成基础路径</el-dropdown-item>
|
|
||||||
</el-dropdown-menu>
|
|
||||||
</template>
|
|
||||||
</el-dropdown>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<template v-if="info.tplCategory == 'tree'">
|
<template v-if="info.tplCategory == 'tree'">
|
||||||
|
|||||||
@ -113,7 +113,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Gen" lang="ts">
|
<script setup name="Gen" lang="ts">
|
||||||
import { delTable, genCode, getDataNames, listTable, previewTable, synchDb } from '@/api/tool/gen';
|
import { delTable, getDataNames, listTable, previewTable, synchDb } from '@/api/tool/gen';
|
||||||
import { TableQuery, TableVO } from '@/api/tool/gen/types';
|
import { TableQuery, TableVO } from '@/api/tool/gen/types';
|
||||||
import router from '@/router';
|
import router from '@/router';
|
||||||
import ImportTable from './importTable.vue';
|
import ImportTable from './importTable.vue';
|
||||||
@ -181,12 +181,7 @@ const handleGenTable = async (row?: TableVO) => {
|
|||||||
proxy?.$modal.msgError('请选择要生成的数据');
|
proxy?.$modal.msgError('请选择要生成的数据');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (row?.genType === '1') {
|
proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
|
||||||
await genCode(row.tableId);
|
|
||||||
proxy?.$modal.msgSuccess('成功生成到自定义路径:' + row.genPath);
|
|
||||||
} else {
|
|
||||||
proxy?.$download.zip('/tool/gen/batchGenCode?tableIdStr=' + tbIds, 'ruoyi.zip');
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
/** 同步数据库操作 */
|
/** 同步数据库操作 */
|
||||||
const handleSynchDb = async (row: TableVO) => {
|
const handleSynchDb = async (row: TableVO) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user