From 1c9091c12848acf504f17bf9accb6127d7c58560 Mon Sep 17 00:00:00 2001 From: zhanglei Date: Mon, 16 Mar 2026 17:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=92=8C=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.yml | 8 ++++---- db.py | 6 +++++- frontend_vue.py | 1 - templates/vue/api.ts.j2 | 8 ++++---- vue-vben-admin/.changeset/README.md | 5 +++++ vue-vben-admin/.changeset/config.json | 18 ++++++++++++++++++ vue-vben-admin/apps/web-antd/.env.development | 2 +- vue-vben-admin/apps/web-antd/.env.production | 2 +- vue-vben-admin/apps/web-antd/src/api/user.ts | 13 +++++++++++-- 9 files changed, 49 insertions(+), 14 deletions(-) create mode 100644 vue-vben-admin/.changeset/README.md create mode 100644 vue-vben-admin/.changeset/config.json diff --git a/config.yml b/config.yml index 7646991..18c993b 100644 --- a/config.yml +++ b/config.yml @@ -31,11 +31,11 @@ package: # 数据库配置 # =============================== db: - host: 192.168.1.80 - port: 3728 + host: 192.168.1.87 + port: 3306 user: root - password: Khq#P9hZ4L@EwCZw - database: health_ai_b + password: 5ea47c0bdd7146ebbd53020eca@672307 + database: health_ai_manage # =============================== # 应用级配置 diff --git a/db.py b/db.py index ede5b27..99bcf27 100644 --- a/db.py +++ b/db.py @@ -1,5 +1,9 @@ import pymysql -from config import DB +import yaml + +with open("./config.yml", "r", encoding="utf-8") as f: + cfg = yaml.safe_load(f) + DB = cfg["db"] def get_conn(): return pymysql.connect( diff --git a/frontend_vue.py b/frontend_vue.py index 2c12943..7feae27 100644 --- a/frontend_vue.py +++ b/frontend_vue.py @@ -55,7 +55,6 @@ def generate(table): "fields":build_fields(table) } - print(ctx) render( "api.ts.j2", f"{API_DIR}/{entity}.ts", diff --git a/templates/vue/api.ts.j2 b/templates/vue/api.ts.j2 index 288be03..5799abb 100644 --- a/templates/vue/api.ts.j2 +++ b/templates/vue/api.ts.j2 @@ -16,7 +16,7 @@ export namespace {{entity}}Api { */ export function page(params: any) { return requestClient.post(applicationConfig.javaURL+'/{{old_table}}/page', params, - { headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1', familyId: 0}}); + { headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1', familyId: 0}}); } /** @@ -31,7 +31,7 @@ export namespace {{entity}}Api { */ export function add(data: any) { return requestClient.post(applicationConfig.javaURL+'/{{old_table}}/add', data, - { headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1', familyId: 0}}); + { headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1', familyId: 0}}); } /** @@ -39,7 +39,7 @@ export namespace {{entity}}Api { */ export function save(data: any) { return requestClient.post(applicationConfig.javaURL+'/{{old_table}}/modify', data, - { headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1', familyId: 0}}); + { headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1', familyId: 0}}); } /** @@ -53,7 +53,7 @@ export namespace {{entity}}Api { * 枚举列表 */ export function enumList(params: any) { - return requestClient.post(applicationConfig.javaURL+'/health-enums/optionList', params,{ headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1'}}); + return requestClient.post(applicationConfig.javaURL+'/health-enums/optionList', params,{ headers: {'Content-Type': 'application/json', Token: '917e9898-8a0a-4079-a16a-e456457e070c', version: '1.0.1'}}); } } \ No newline at end of file diff --git a/vue-vben-admin/.changeset/README.md b/vue-vben-admin/.changeset/README.md new file mode 100644 index 0000000..5654e89 --- /dev/null +++ b/vue-vben-admin/.changeset/README.md @@ -0,0 +1,5 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/vue-vben-admin/.changeset/config.json b/vue-vben-admin/.changeset/config.json new file mode 100644 index 0000000..f954fb4 --- /dev/null +++ b/vue-vben-admin/.changeset/config.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", + "changelog": [ + "@changesets/changelog-github", + { "repo": "vbenjs/vue-vben-admin" } + ], + "commit": false, + "fixed": [["@vben-core/*", "@vben/*"]], + "snapshot": { + "prereleaseTemplate": "{tag}-{datetime}" + }, + "privatePackages": { "version": true, "tag": true }, + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/vue-vben-admin/apps/web-antd/.env.development b/vue-vben-admin/apps/web-antd/.env.development index 3f51749..dfd03c1 100644 --- a/vue-vben-admin/apps/web-antd/.env.development +++ b/vue-vben-admin/apps/web-antd/.env.development @@ -6,7 +6,7 @@ VITE_BASE=/ # 接口地址 VITE_GLOB_API_URL=/api # VITE_GLOB_API_URL=http://localhost:8083/api/models -VITE_GLOB_JAVA_API_URL=http://192.168.1.47:8083/api/models +VITE_GLOB_JAVA_API_URL=http://192.168.1.87:8084/mg/models # 是否开启 Nitro Mock服务,true 为开启,false 为关闭 VITE_NITRO_MOCK=true diff --git a/vue-vben-admin/apps/web-antd/.env.production b/vue-vben-admin/apps/web-antd/.env.production index e5f9ba5..04feb7f 100644 --- a/vue-vben-admin/apps/web-antd/.env.production +++ b/vue-vben-admin/apps/web-antd/.env.production @@ -4,7 +4,7 @@ VITE_BASE=/ VITE_GLOB_API_URL=https://mock-napi.vben.pro/api # VITE_GLOB_API_URL=http://localhost:8083/api/models -VITE_GLOB_JAVA_API_URL=http://192.168.1.47:8083/api/models +VITE_GLOB_JAVA_API_URL=http://192.168.1.87:8084/mg/models # 是否开启压缩,可以设置为 none, brotli, gzip VITE_COMPRESS=none diff --git a/vue-vben-admin/apps/web-antd/src/api/user.ts b/vue-vben-admin/apps/web-antd/src/api/user.ts index 7a11bee..e60f328 100644 --- a/vue-vben-admin/apps/web-antd/src/api/user.ts +++ b/vue-vben-admin/apps/web-antd/src/api/user.ts @@ -27,10 +27,19 @@ export namespace userApi { } /** - * 新增 / 修改 + * 新增 + */ + export function add(data: any) { + return requestClient.post(applicationConfig.javaURL+'/health-user/add', data, + { headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1', familyId: 0}}); + } + + /** + * 修改 */ export function save(data: any) { - return requestClient.post(applicationConfig.javaURL+'/health-user', data); + return requestClient.post(applicationConfig.javaURL+'/health-user/modify', data, + { headers: {'Content-Type': 'application/json', Token: 'ded93460-0cf5-45db-81ae-7608dbd3f51e', version: '1.0.1', familyId: 0}}); } /**