diff --git a/new-ui/pnpm-lock.yaml b/new-ui/pnpm-lock.yaml index 1a97e1b2..b91a1de8 100644 --- a/new-ui/pnpm-lock.yaml +++ b/new-ui/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' settings: autoInstallPeers: true @@ -127,103 +127,6 @@ importers: specifier: ^1.8.27 version: 1.8.27(typescript@5.3.3) - projects/mobile: - dependencies: - '@element-plus/icons-vue': - specifier: ^2.1.0 - version: 2.3.1(vue@3.4.21) - axios: - specifier: ^0.27.2 - version: 0.27.2 - clipboard: - specifier: ^2.0.11 - version: 2.0.11 - compressorjs: - specifier: ^1.2.1 - version: 1.2.1 - core-js: - specifier: ^3.8.3 - version: 3.36.0 - element-plus: - specifier: ^2.3.0 - version: 2.6.1(vue@3.4.21) - good-storage: - specifier: ^1.1.1 - version: 1.1.1 - highlight.js: - specifier: ^11.7.0 - version: 11.9.0 - json-bigint: - specifier: ^1.0.0 - version: 1.0.0 - lodash: - specifier: ^4.17.21 - version: 4.17.21 - markdown-it: - specifier: ^13.0.1 - version: 13.0.2 - markdown-it-latex2img: - specifier: ^0.0.6 - version: 0.0.6 - markdown-it-mathjax: - specifier: ^2.0.0 - version: 2.0.0 - md-editor-v3: - specifier: ^2.2.1 - version: 2.11.3(vue@3.4.21) - pinia: - specifier: ^2.1.4 - version: 2.1.7(typescript@5.3.3)(vue@3.4.21) - qrcode: - specifier: ^1.5.3 - version: 1.5.3 - qs: - specifier: ^6.11.1 - version: 6.12.0 - sortablejs: - specifier: ^1.15.0 - version: 1.15.2 - v3-waterfall: - specifier: ^1.2.1 - version: 1.3.3 - vant: - specifier: ^4.5.0 - version: 4.8.5(vue@3.4.21) - vue: - specifier: ^3.2.13 - version: 3.4.21(typescript@5.3.3) - vue-router: - specifier: ^4.0.15 - version: 4.3.0(vue@3.4.21) - devDependencies: - '@babel/core': - specifier: 7.18.6 - version: 7.18.6 - '@babel/eslint-parser': - specifier: ^7.12.16 - version: 7.23.10(@babel/core@7.18.6)(eslint@7.32.0) - '@vue/cli-plugin-babel': - specifier: ~5.0.0 - version: 5.0.8(@vue/cli-service@5.0.8)(core-js@3.36.0)(vue@3.4.21) - '@vue/cli-plugin-eslint': - specifier: ~5.0.0 - version: 5.0.8(@vue/cli-service@5.0.8)(eslint@7.32.0) - '@vue/cli-service': - specifier: ~5.0.0 - version: 5.0.8(lodash@4.17.21)(prettier@3.2.5)(stylus-loader@7.1.3)(vue@3.4.21) - eslint: - specifier: ^7.32.0 - version: 7.32.0 - eslint-plugin-vue: - specifier: ^8.0.3 - version: 8.7.1(eslint@7.32.0) - stylus: - specifier: ^0.58.1 - version: 0.58.1 - stylus-loader: - specifier: ^7.0.0 - version: 7.1.3(stylus@0.58.1)(webpack@5.90.3) - projects/web: dependencies: '@element-plus/icons-vue': diff --git a/new-ui/projects/admin/.vscode/extensions.json b/new-ui/projects/admin/.vscode/extensions.json deleted file mode 100644 index 4771846f..00000000 --- a/new-ui/projects/admin/.vscode/extensions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "recommendations": [ - "Vue.volar", - "Vue.vscode-typescript-vue-plugin", - "dbaeumer.vscode-eslint" - ] -} diff --git a/new-ui/projects/admin/src/components/CustomUploader.vue b/new-ui/projects/admin/src/components/CustomUploader.vue new file mode 100644 index 00000000..4b98e924 --- /dev/null +++ b/new-ui/projects/admin/src/components/CustomUploader.vue @@ -0,0 +1,49 @@ + + + + + + + + + + + + + diff --git a/new-ui/projects/admin/src/components/SimpleTable/SimpleTable.vue b/new-ui/projects/admin/src/components/SimpleTable/SimpleTable.vue index 78e1a22c..28a58989 100644 --- a/new-ui/projects/admin/src/components/SimpleTable/SimpleTable.vue +++ b/new-ui/projects/admin/src/components/SimpleTable/SimpleTable.vue @@ -1,18 +1,17 @@ + + + 新增 + + + + + + 购买API-KEY + + + 编辑 删除 - - 新增 - - + {{ record[column.dataIndex] }} diff --git a/new-ui/projects/admin/src/views/ApiKey/ApiKeyForm.vue b/new-ui/projects/admin/src/views/ApiKey/ApiKeyForm.vue index eedd4dbf..0d064b73 100644 --- a/new-ui/projects/admin/src/views/ApiKey/ApiKeyForm.vue +++ b/new-ui/projects/admin/src/views/ApiKey/ApiKeyForm.vue @@ -1,9 +1,8 @@ - {{ - `注意:如果是百度文心一言平台,API-KEY 为 APIKey|SecretKey,中间用竖线(|)连接\n注意:如果是讯飞星火大模型,API-KEY 为 AppId|APIKey|APISecret,中间用竖线(|)连接` - }} + 注意:如果是百度文心一言平台,API-KEY 为 APIKey|SecretKey,中间用竖线(|)连接 + 注意:如果是讯飞星火大模型,API-KEY 为 AppId|APIKey|APISecret,中间用竖线(|)连接 - + - + - - - - + + + + + + @@ -86,7 +97,7 @@ defineExpose({ form, }); -const typeOPtions = [ +const typeOptions = [ { label: "聊天", value: "chart", @@ -96,6 +107,48 @@ const typeOPtions = [ value: "img", }, ]; + +const platformOptions = [ + { + label: "【OpenAI】ChatGPT", + value: "OpenAI", + api_url: "https://gpt.bemore.lol/v1/chat/completions", + img_url: "https://gpt.bemore.lol/v1/images/generations", + }, + { + label: "【讯飞】星火大模型", + value: "XunFei", + api_url: "wss://spark-api.xf-yun.com/{version}/chat", + }, + { + label: "【清华智普】ChatGLM", + value: "ChatGLM", + api_url: "https://open.bigmodel.cn/api/paas/v3/model-api/{model}/sse-invoke", + }, + { + label: "【百度】文心一言", + value: "Baidu", + api_url: "https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/{model}", + }, + { + label: "【微软】Azure", + value: "Azure", + api_url: + "https://chat-bot-api.openai.azure.com/openai/deployments/{model}/chat/completions?api-version=2023-05-15", + }, + { + label: "【阿里】千义通问", + value: "QWen", + api_url: "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation", + }, +]; + +const handlePlatformChange = () => { + const obj = platformOptions.find((item) => item.value === form.value.platform); + if (obj) { + form.value.api_url = form.value.type === "img" ? obj.img_url : obj.api_url; + } +};