diff --git a/gpt-vue/pnpm-lock.yaml b/gpt-vue/pnpm-lock.yaml index 8efa9db5..3c952c6d 100644 --- a/gpt-vue/pnpm-lock.yaml +++ b/gpt-vue/pnpm-lock.yaml @@ -35,6 +35,9 @@ importers: '@gpt-vue/packages': specifier: workspace:^1.0.0 version: link:../../packages + md-editor-v3: + specifier: ^2.2.1 + version: 2.11.3(vue@3.4.21) pinia: specifier: ^2.1.7 version: 2.1.7(typescript@5.3.3)(vue@3.4.21) @@ -2243,6 +2246,14 @@ packages: dev: true optional: true + /md-editor-v3@2.11.3(vue@3.4.21): + resolution: {integrity: sha512-SCfS4qMy0HldFdplcIGUMCpSv8qkNWkYShSdv2gTHeViKduA34zV89BOrWcqls2EZSlvt2n3G7nHRzYUvJjDKw==} + peerDependencies: + vue: ^3.2.47 + dependencies: + vue: 3.4.21(typescript@5.3.3) + dev: false + /memorystream@0.3.1: resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} engines: {node: '>= 0.10.0'} diff --git a/gpt-vue/projects/vue-admin/package.json b/gpt-vue/projects/vue-admin/package.json index 5c22a12c..707518d2 100644 --- a/gpt-vue/projects/vue-admin/package.json +++ b/gpt-vue/projects/vue-admin/package.json @@ -14,6 +14,7 @@ "dependencies": { "@arco-design/web-vue": "^2.54.6", "@gpt-vue/packages": "workspace:^1.0.0", + "md-editor-v3": "^2.2.1", "pinia": "^2.1.7", "vue": "^3.4.15", "vue-router": "^4.2.5" diff --git a/gpt-vue/projects/vue-admin/src/composables/useSubmit.ts b/gpt-vue/projects/vue-admin/src/composables/useSubmit.ts index e0b31af2..64e8db0d 100644 --- a/gpt-vue/projects/vue-admin/src/composables/useSubmit.ts +++ b/gpt-vue/projects/vue-admin/src/composables/useSubmit.ts @@ -1,9 +1,9 @@ import { ref, reactive, unref } from "vue"; import { Message } from "@arco-design/web-vue"; import type { BaseResponse } from "@gpt-vue/packages/type"; -function useSubmit, R = any>(defaultData: T) { +function useSubmit = Record, R = any>(defaultData?: T) { const formRef = ref(); - const formData = reactive({ ...defaultData }); + const formData = reactive>({ ...defaultData ?? {} }); const submitting = ref(false); const handleSubmit = async (api: (params?: any) => Promise>, params) => { @@ -11,7 +11,7 @@ function useSubmit, R = any>(defaultData: T) { try { const hasError = await formRef.value?.validate(); if (!hasError) { - const { data, message } = await api({ ...formData, ...unref(params) }); + const { data, message } = await api({ ...formData ?? {}, ...unref(params) }); Message.success(message); return Promise.resolve({ formData, data }); } diff --git a/gpt-vue/projects/vue-admin/src/http/config.ts b/gpt-vue/projects/vue-admin/src/http/config.ts index 6a815f74..95ff3eff 100644 --- a/gpt-vue/projects/vue-admin/src/http/config.ts +++ b/gpt-vue/projects/vue-admin/src/http/config.ts @@ -2,7 +2,7 @@ import { Notification } from "@arco-design/web-vue"; import createInstance from "@gpt-vue/packages/request" import type { BaseResponse } from "@gpt-vue/packages/type"; -export const uploadUrl = import.meta.env.VITE_PROXY_BASE_URL + "/common/upload/minio"; +export const uploadUrl = import.meta.env.VITE_PROXY_BASE_URL + "/api/upload"; export const instance = createInstance() diff --git a/gpt-vue/projects/vue-admin/src/router/menu.ts b/gpt-vue/projects/vue-admin/src/router/menu.ts index 55fd6a3a..c8ab464a 100644 --- a/gpt-vue/projects/vue-admin/src/router/menu.ts +++ b/gpt-vue/projects/vue-admin/src/router/menu.ts @@ -3,6 +3,7 @@ import { IconDashboard, IconOrderedList, IconCalendar, + IconSettings, } from "@arco-design/web-vue/es/icon"; const menu = [ @@ -60,6 +61,15 @@ const menu = [ }, component: () => import('@/views/Chats/ChatsContainer.vue') }, + { + path: '/system', + name: 'System', + meta: { + title: "系统设置", + icon: IconSettings, + }, + component: () => import('@/views/System/SystemContainer.vue') + }, { path: '/loginLog', name: 'LoginLog', diff --git a/gpt-vue/projects/vue-admin/src/views/System/SystemBaseConfig.vue b/gpt-vue/projects/vue-admin/src/views/System/SystemBaseConfig.vue new file mode 100644 index 00000000..55335541 --- /dev/null +++ b/gpt-vue/projects/vue-admin/src/views/System/SystemBaseConfig.vue @@ -0,0 +1,149 @@ + + diff --git a/gpt-vue/projects/vue-admin/src/views/System/SystemChatConfig.vue b/gpt-vue/projects/vue-admin/src/views/System/SystemChatConfig.vue new file mode 100644 index 00000000..fb5aa9f0 --- /dev/null +++ b/gpt-vue/projects/vue-admin/src/views/System/SystemChatConfig.vue @@ -0,0 +1,131 @@ + + diff --git a/gpt-vue/projects/vue-admin/src/views/System/SystemContainer.vue b/gpt-vue/projects/vue-admin/src/views/System/SystemContainer.vue new file mode 100644 index 00000000..e3f51e19 --- /dev/null +++ b/gpt-vue/projects/vue-admin/src/views/System/SystemContainer.vue @@ -0,0 +1,20 @@ + + diff --git a/gpt-vue/projects/vue-admin/src/views/System/SystemNoticeConfig.vue b/gpt-vue/projects/vue-admin/src/views/System/SystemNoticeConfig.vue new file mode 100644 index 00000000..5c4c8b6c --- /dev/null +++ b/gpt-vue/projects/vue-admin/src/views/System/SystemNoticeConfig.vue @@ -0,0 +1,65 @@ + + diff --git a/gpt-vue/projects/vue-admin/src/views/System/SystemUploader.vue b/gpt-vue/projects/vue-admin/src/views/System/SystemUploader.vue new file mode 100644 index 00000000..f98d0ed2 --- /dev/null +++ b/gpt-vue/projects/vue-admin/src/views/System/SystemUploader.vue @@ -0,0 +1,36 @@ + + diff --git a/gpt-vue/projects/vue-admin/src/views/System/api.ts b/gpt-vue/projects/vue-admin/src/views/System/api.ts new file mode 100644 index 00000000..1a01fcda --- /dev/null +++ b/gpt-vue/projects/vue-admin/src/views/System/api.ts @@ -0,0 +1,25 @@ +import http from "@/http/config"; + +export const getConfig = (params) => { + return http({ + url: "/api/admin/config/get", + method: "get", + params + }) +} + +export const save = (data) => { + return http({ + url: "/api/admin/config/update", + method: "post", + data + }) +} + +export const modelList = (params) => { + return http({ + url: "/api/admin/model/list", + method: "get", + params + }) +}