From 412e0a01ac00fb0797bb8327b7b203b5b9d10001 Mon Sep 17 00:00:00 2001 From: yangws <1607839436@qq.com> Date: Thu, 18 Jul 2024 10:45:33 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E5=A4=B4=E5=83=8F?= =?UTF-8?q?=E9=A2=84=E8=A7=88=EF=BC=8C=E5=A4=B4=E5=83=8F=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?bug=EF=BC=8C=E4=BB=A5=E5=8F=8A=E9=BB=84=E8=89=B2=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/api/system/user.js | 11 +++++++---- src/renderer/src/views/profile/userAvatar.vue | 19 +++++++++++++------ src/renderer/src/views/profile/userInfo.vue | 16 ++++++++-------- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/renderer/src/api/system/user.js b/src/renderer/src/api/system/user.js index c83e0f6..b7e9e23 100644 --- a/src/renderer/src/api/system/user.js +++ b/src/renderer/src/api/system/user.js @@ -7,7 +7,7 @@ export function getUserProfile() { method: 'get' }) } - + // 修改用户个人信息 export function updateUserProfile(data) { return request({ @@ -16,7 +16,7 @@ export function getUserProfile() { data: data }) } - + // 用户密码重置 export function updateUserPwd(oldPassword, newPassword) { const data = { @@ -29,11 +29,14 @@ export function getUserProfile() { params: data }) } - + // 用户头像上传 export function uploadAvatar(data) { return request({ url: '/system/user/profile/avatar', + headers: { + 'Content-Type': 'multipart/form-data' + }, method: 'post', data: data }) @@ -46,4 +49,4 @@ export function updateUserInfo(data) { method: 'put', data: data }) -} \ No newline at end of file +} diff --git a/src/renderer/src/views/profile/userAvatar.vue b/src/renderer/src/views/profile/userAvatar.vue index b301307..1c289a4 100644 --- a/src/renderer/src/views/profile/userAvatar.vue +++ b/src/renderer/src/views/profile/userAvatar.vue @@ -26,7 +26,7 @@
- +
@@ -64,7 +64,7 @@ - + - + \ No newline at end of file + diff --git a/src/renderer/src/views/profile/userInfo.vue b/src/renderer/src/views/profile/userInfo.vue index c560d39..808e344 100644 --- a/src/renderer/src/views/profile/userInfo.vue +++ b/src/renderer/src/views/profile/userInfo.vue @@ -11,16 +11,16 @@ - - + + - - + \ No newline at end of file + From 1d069c72a3330445efd2be85db766dcb12f1f1e9 Mon Sep 17 00:00:00 2001 From: lyc Date: Thu, 18 Jul 2024 11:10:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 66 ++++++++++++++++++- src/renderer/src/components/Versions.vue | 13 ---- src/renderer/src/layout/components/Header.vue | 16 +++-- src/renderer/src/utils/request.js | 2 +- 4 files changed, 74 insertions(+), 23 deletions(-) delete mode 100644 src/renderer/src/components/Versions.vue diff --git a/README.md b/README.md index ae002ac..f453515 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,72 @@ $ npm run build:linux ├── .prettierrc.yaml //prettier代码格式化配置文件 ├── dev-app-update.yml ├── electron-builder.yml //打包配置文件 -├──electron.vite.config.mjs //electron-vite配置文件 +├── electron.vite.config.mjs //electron-vite配置文件 ├── package-lock.json ├── package.json -└──README.md //项目说明 +└── README.md //项目说明 ``` + + +### electron-builder.yml配置说明 + +```json +appId: com.electron.test //appid 包名 +productName: 测试程序 //安装程序的名字 +directories: + buildResources: build +files: + - '!**/.vscode/*' + - '!src/*' + - '!electron.vite.config.{js,ts,mjs,cjs}' + - '!{.eslintignore,.eslintrc.cjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}' + - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}' + - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' +asarUnpack: + - resources +win: + executableName: 测试程序 + icon: build/icon/favicon.ico //程序图标 +nsis: + oneClick: false //是否一键安装 + allowElevation: true //允许请求提升。若为false,则用户必须使用提升的权限重新启动安装程序。 + allowToChangeInstallationDirectory: true //是否允许修改安装目录 + createDesktopShortcut: true //卸载时图标 + createStartMenuShortcut: true // 是否创建开始菜单图标 + runAfterFinish: false //是否安装完成后运行 + include: ../build/script/installer.nsh //我这里放的是将应用程序默认安装在哪个路径 + artifactName: ${name}-${version}-setup.${ext} + uninstallDisplayName: ${productName} + installerIcon: ./build/icon.ico // 安装时图标 + uninstallerIcon: ./build/icon.ico +mac: + entitlementsInherit: build/entitlements.mac.plist + extendInfo: + - NSCameraUsageDescription: Application requests access to the device's camera. + - NSMicrophoneUsageDescription: Application requests access to the device's microphone. + - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder. + - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder. + notarize: false +dmg: + artifactName: ${name}-${version}.${ext} +linux: + target: + - AppImage + - snap + - deb + maintainer: electronjs.org + category: Utility +appImage: + artifactName: ${name}-${version}.${ext} +npmRebuild: false +publish: + provider: generic + url: https://example.com/auto-updates //程序升级的验证地址 +electronDownload: + mirror: https://npmmirror.com/mirrors/electron/ +``` + + + diff --git a/src/renderer/src/components/Versions.vue b/src/renderer/src/components/Versions.vue deleted file mode 100644 index 35136c0..0000000 --- a/src/renderer/src/components/Versions.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/src/renderer/src/layout/components/Header.vue b/src/renderer/src/layout/components/Header.vue index 67812b3..7744e10 100644 --- a/src/renderer/src/layout/components/Header.vue +++ b/src/renderer/src/layout/components/Header.vue @@ -18,7 +18,7 @@ {{ isMaxSize ? '' : '' }} - +
@@ -209,19 +209,21 @@ function setLayout() { flex-direction: column; .header-tool { - padding-top: 5px; -webkit-app-region: no-drag; - span { border-radius: 3px; cursor: pointer; - + padding: 2px 10px; &:hover { background-color: #c4c4c4; } - - .iconfont { - margin: 0 10px; + } + .close{ + &:hover{ + background-color: #fb4a3e; + .iconfont{ + color: #fff; + } } } } diff --git a/src/renderer/src/utils/request.js b/src/renderer/src/utils/request.js index 6cfd1fc..4cf8f15 100644 --- a/src/renderer/src/utils/request.js +++ b/src/renderer/src/utils/request.js @@ -55,7 +55,7 @@ service.interceptors.request.use(config => { const s_url = sessionObj.url; // 请求地址 const s_data = sessionObj.data; // 请求数据 const s_time = sessionObj.time; // 请求时间 - const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 + const interval = 2000; // 间隔时间(ms),小于此时间视为重复提交 if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { const message = '数据正在处理,请勿重复提交'; console.warn(`[${s_url}]: ` + message) From effe6c32727a674bfef5378052f9a5731294280f Mon Sep 17 00:00:00 2001 From: lyc Date: Thu, 18 Jul 2024 15:14:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E6=89=93=E5=8C=85=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 15 +++++++++++++++ electron-builder.yml | 4 ++-- src/renderer/src/components/move-file/index.vue | 2 +- .../src/components/select-subject/index.vue | 2 +- .../src/components/upload-dialog/index.vue | 2 +- src/renderer/src/layout/components/Header.vue | 4 ++-- src/renderer/src/utils/auth.js | 6 +++--- 7 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 .env.production diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..5929a05 --- /dev/null +++ b/.env.production @@ -0,0 +1,15 @@ +# 页面标题 +VITE_APP_TITLE = AIx数字平台 + +# 生产环境配置 +VITE_APP_ENV = 'production' + +# AIx融合数字管理系统/生产环境 +VITE_APP_BASE_API = 'http://192.168.2.52:7863' + +# 是否在打包时开启压缩,支持 gzip 和 brotli +VITE_BUILD_COMPRESS = gzip + +VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktxt/' + +VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/' \ No newline at end of file diff --git a/electron-builder.yml b/electron-builder.yml index 5c1d02b..52741c5 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -1,5 +1,5 @@ appId: com.electron.app -productName: electron-app +productName: AIx directories: buildResources: build files: @@ -11,7 +11,7 @@ files: asarUnpack: - resources/** win: - executableName: electron-app + executableName: AIx nsis: oneClick: false allowToChangeInstallationDirectory: true diff --git a/src/renderer/src/components/move-file/index.vue b/src/renderer/src/components/move-file/index.vue index 71c7837..79926df 100644 --- a/src/renderer/src/components/move-file/index.vue +++ b/src/renderer/src/components/move-file/index.vue @@ -54,7 +54,7 @@