diff --git a/.env.production b/.env.production deleted file mode 100644 index ee94de16dc20bc3a659de13b218f852b95045cec..0000000000000000000000000000000000000000 --- a/.env.production +++ /dev/null @@ -1,24 +0,0 @@ -# 是否开启mock -VITE_USE_MOCK=true -# 接口地址 可以由nginx做转发或者直接写实际地址 -VITE_GLOB_API_URL=/basic-api -# 文件上传地址 可以由nginx做转发或者直接写实际地址 -VITE_GLOB_UPLOAD_URL=/upload -# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换 -VITE_GLOB_API_URL_PREFIX= -# 是否删除Console.log -VITE_DROP_CONSOLE=false -# 资源公共路径,需要以 / 开头和结尾 -VITE_PUBLIC_PATH=/ -# 打包是否输出gz|br文件 -# 可选: gzip | brotli | none -# 也可以有多个, 例如 ‘gzip’|'brotli',这样会同时生成 .gz和.br文件 -VITE_BUILD_COMPRESS='none' -# 打包是否压缩图片 -VITE_USE_IMAGEMIN=false -# 打包是否开启pwa功能 -VITE_USE_PWA=false -# 是否兼容旧版浏览器。开启后打包时间会慢一倍左右。会多打出旧浏览器兼容包,且会根据浏览器兼容性自动使用相应的版本 -VITE_LEGACY=false - -VITE_GLOB_GEN_TABLE_URL=http://localhost:8199 diff --git a/.gitignore b/.gitignore index 81d3255a7682bfec24e4fdb8fff6f9106626b2c3..63bd04477f3545db66d72014b583dfacc16f1874 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ node_modules dist .npmrc .cache +.env.production +mock/sys/user tests/server/static tests/server/static/upload diff --git a/mock/sys/user.ts b/mock/sys/user.ts index 35bf3ea2ff667a541451d62871be1baea9dd286d..5c12b593ea07d2d36acf8a636160b44726b1d6af 100644 --- a/mock/sys/user.ts +++ b/mock/sys/user.ts @@ -7,7 +7,7 @@ export function createFakeUserList() { userId: '1', username: 'gen', realName: 'Gen Admin', - avatar: '/resource/img/avatar.png', + avatar: 'resource/img/avatar.png', desc: 'manager', password: '123456', token: 'fakeToken1', @@ -24,7 +24,8 @@ export function createFakeUserList() { username: 'test', password: '123456', realName: 'test user', - avatar: 'https://q1.qlogo.cn/g?b=qq&nk=339449197&s=640', + avatar: 'resource/img/avatar.png', + // avatar: 'https://q1.qlogo.cn/g?b=qq&nk=339449197&s=640', desc: 'tester', token: 'fakeToken2', homePath: '/dashboard/workbench', diff --git a/src/views/sys/login/LoginForm.vue b/src/views/sys/login/LoginForm.vue index fa88561a86f8677287f0dcc1f8fc87a33bba214f..8fd1b0dcab01d67dc0f67eb970939f0774b418d0 100644 --- a/src/views/sys/login/LoginForm.vue +++ b/src/views/sys/login/LoginForm.vue @@ -119,7 +119,7 @@ const rememberMe = ref(false); const formData = reactive({ - account: 'gen', + account: 'test', password: '123456', }); diff --git a/src/views/tool/datasource/api/index.ts b/src/views/tool/datasource/api/index.ts index ff078ccefa1c511098c408616ca3c0e4e152f1fa..4d8a31890d3a782fa73203efb7a8965469703973 100644 --- a/src/views/tool/datasource/api/index.ts +++ b/src/views/tool/datasource/api/index.ts @@ -54,11 +54,27 @@ export function addAPI(params: itemInter) { }, { apiUrl: genTableUrl, - successMessageMode:"message", + successMessageMode: 'message', + }, + ); +} +/** + * @vuese + * @Description: 编辑 + * @arg {any} params + */ +export function editAPI(params: any) { + return defHttp.put( + { + url: `/tool/db`, + params, + }, + { + apiUrl: genTableUrl, + successMessageMode: 'message', }, ); } - export function delAPI(params: delParamsInter) { return defHttp.delete( { @@ -68,7 +84,19 @@ export function delAPI(params: delParamsInter) { { apiUrl: genTableUrl, isReturnNativeResponse: true, - successMessageMode:"message", + successMessageMode: 'message', + }, + ); +} +export function testAPI(params: itemInter) { + return defHttp.post( + { + url: '/tool/db/test', + params, + }, + { + apiUrl: genTableUrl, + isReturnNativeResponse: true, }, ); } diff --git a/src/views/tool/datasource/config.ts b/src/views/tool/datasource/config.ts index 57320631180087d4f9dd926806a5834d64d20ea6..229e2fad576c33c563259b9d6ee8ea5efda89249 100644 --- a/src/views/tool/datasource/config.ts +++ b/src/views/tool/datasource/config.ts @@ -1,5 +1,5 @@ -import {FormProps, FormSchema} from '/@/components/Table'; -import {BasicColumn} from '/@/components/Table/src/types/table'; +import { FormProps, FormSchema } from '/@/components/Table'; +import { BasicColumn } from '/@/components/Table/src/types/table'; export function getBasicColumns(): BasicColumn[] { return [ @@ -44,7 +44,6 @@ export function getBasicColumns(): BasicColumn[] { ]; } - export function getFormConfig(): Partial { return { labelWidth: 100, @@ -73,6 +72,12 @@ export function getFormConfig(): Partial { export function formSchema(isUpdate: boolean): FormSchema[] { return [ + { + field: 'id', + label: 'id', + component: 'Input', + ifShow: false, + }, { field: 'group', label: '分组', @@ -135,10 +140,10 @@ export function formSchema(isUpdate: boolean): FormSchema[] { defaultValue: 'mysql', componentProps: { options: [ - {label: 'mysql', value: 'mysql'}, - {label: 'oracle', value: 'oracle'}, - {label: 'pgsql', value: 'pgsql'}, - {label: 'mssql', value: 'mssql'}, + { label: 'mysql', value: 'mysql' }, + { label: 'oracle', value: 'oracle' }, + { label: 'pgsql', value: 'pgsql' }, + { label: 'mssql', value: 'mssql' }, ], }, colProps: { diff --git a/src/views/tool/datasource/index.vue b/src/views/tool/datasource/index.vue index 1696e803e32fb3e921b7730a999ac358a02a2196..b24685f3ceda76f59617b6e93abc45c4fc461a96 100644 --- a/src/views/tool/datasource/index.vue +++ b/src/views/tool/datasource/index.vue @@ -6,16 +6,17 @@ diff --git a/src/views/tool/gen/edit/config.ts b/src/views/tool/gen/edit/config.ts index 1db77127b51317952c5847c4fbea1d3fd05311a0..3149dfa713f7c2155ccd7fff4a69825d69d17f0c 100644 --- a/src/views/tool/gen/edit/config.ts +++ b/src/views/tool/gen/edit/config.ts @@ -138,19 +138,19 @@ export function getFormConfig(type: string, params?: { treeOptions: any; tableIn field: 'systemName', component: 'Input', label: '生成系统名', - required: true, + required: false, }, { field: 'packageName', component: 'Input', label: '生成包路径', - required: true, + required: false, }, { field: 'moduleName', component: 'Input', label: '生成模块名', - required: true, + required: false, }, { field: 'businessName', @@ -278,7 +278,7 @@ export function getFormConfig(type: string, params?: { treeOptions: any; tableIn field: 'functionAuthor', component: 'Input', label: '作者', - required: true, + required: false, }, { field: 'remark', diff --git a/src/views/tool/tpl/modal/editor/index.vue b/src/views/tool/tpl/modal/editor/index.vue index f0c5d0eaa81558f9a909f64065972be0baf8a1c8..f6672ec828fa1c415454ef143a04c422c61d6f1f 100644 --- a/src/views/tool/tpl/modal/editor/index.vue +++ b/src/views/tool/tpl/modal/editor/index.vue @@ -5,12 +5,15 @@ * @FilePath: \src\views\tool\tpl\modal\editor\index.vue --> @@ -21,7 +24,7 @@ import { getFormConfig } from './config'; import monacoEditor from '/@/components/Custom/MonacoEditor/index.vue'; import * as _API from '../../api'; - import { Modal } from 'ant-design-vue'; + import { Modal } from 'ant-design-vue'; import diffModal from '../diff/index.vue'; export default defineComponent({ name: 'tplForm', @@ -69,8 +72,7 @@ } closeModal(); emit('success'); - } catch { - } + } catch {} }; const handleSubmit = () => { Modal.confirm({