diff --git a/.env.production b/.env.production
index 993cace..3998cfc 100644
--- a/.env.production
+++ b/.env.production
@@ -5,15 +5,15 @@ VITE_APP_TITLE = AIx数字平台
VITE_APP_ENV = 'production'
# AIx融合数字管理系统/生产环境
-VITE_APP_BASE_API = 'https://file.ysaix.com:7868/prod-api'
+VITE_APP_BASE_API = 'https://prev.ysaix.com:7868/prod-api'
-VITE_APP_DOMAIN = 'file.ysaix.com'
+VITE_APP_DOMAIN = 'prev.ysaix.com'
-VITE_APP_UPLOAD_API = 'https://file.ysaix.com:7868/prod-api'
+VITE_APP_UPLOAD_API = 'https://prev.ysaix.com:7868/prod-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip
-VITE_APP_RES_FILE_PATH = 'https://file.ysaix.com:7868/src/assets/textbook/booktxt/'
+VITE_APP_RES_FILE_PATH = 'https://prev.ysaix.com:7868/src/assets/textbook/booktxt/'
-VITE_APP_BUILD_BASE_PATH = 'https://file.ysaix.com:7868/'
+VITE_APP_BUILD_BASE_PATH = 'https://prev.ysaix.com:7868/'
diff --git a/.env.test b/.env.test
new file mode 100644
index 0000000..993cace
--- /dev/null
+++ b/.env.test
@@ -0,0 +1,19 @@
+# 页面标题
+VITE_APP_TITLE = AIx数字平台
+
+# 生产环境配置
+VITE_APP_ENV = 'production'
+
+# AIx融合数字管理系统/生产环境
+VITE_APP_BASE_API = 'https://file.ysaix.com:7868/prod-api'
+
+VITE_APP_DOMAIN = 'file.ysaix.com'
+
+VITE_APP_UPLOAD_API = 'https://file.ysaix.com:7868/prod-api'
+
+# 是否在打包时开启压缩,支持 gzip 和 brotli
+VITE_BUILD_COMPRESS = gzip
+
+VITE_APP_RES_FILE_PATH = 'https://file.ysaix.com:7868/src/assets/textbook/booktxt/'
+
+VITE_APP_BUILD_BASE_PATH = 'https://file.ysaix.com:7868/'
diff --git a/electron-builder-prod.yml b/electron-builder-prod.yml
new file mode 100644
index 0000000..29c65e8
--- /dev/null
+++ b/electron-builder-prod.yml
@@ -0,0 +1,47 @@
+appId: com.electron.app
+productName: AIx
+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}'
+asarUnpack:
+ - resources/**
+win:
+ executableName: AIx
+ icon: resources/logo2.ico
+nsis:
+ oneClick: false
+ allowToChangeInstallationDirectory: true
+ artifactName: ${name}-${version}-setup.${ext}
+ shortcutName: ${productName}
+ uninstallDisplayName: ${productName}
+ createDesktopShortcut: always
+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://prev.ysaix.com:7868/src/assets/smarttalk/
+electronDownload:
+ mirror: https://npmmirror.com/mirrors/electron/
diff --git a/package.json b/package.json
index 3abf345..faed0b1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "aix-win",
- "version": "1.0.2",
+ "version": "1.0.4",
"description": "An Electron application with Vue",
"main": "./out/main/index.js",
"author": "example.com",
@@ -14,7 +14,8 @@
"postinstall": "electron-builder install-app-deps",
"build:unpack": "npm run build && electron-builder --dir",
"build:dev": "npm run build && electron-builder --win --config ./electron-builder-test.yml",
- "build:test": "npm run build && electron-builder --win --config ./electron-builder.yml",
+ "build:test": "electron-vite build --mode test && electron-builder --win --config ./electron-builder.yml",
+ "build:prod": "electron-vite build --mode production && electron-builder --win --config ./electron-builder-prod.yml",
"build:mac": "npm run build && electron-builder --mac",
"build:linux": "npm run build && electron-builder --linux"
},
diff --git a/src/main/file.js b/src/main/file.js
index d10cb59..c671519 100644
--- a/src/main/file.js
+++ b/src/main/file.js
@@ -77,10 +77,10 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
console.error('Error uploading file:', err)
}
})
- }, 5000)
+ }, 20000)
}
})
- }, 1000)
+ }, 10000)
})
function getFileMD5(path) {
diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue
index ae8d243..9693126 100644
--- a/src/renderer/src/components/choose-textbook/index.vue
+++ b/src/renderer/src/components/choose-textbook/index.vue
@@ -71,6 +71,8 @@ const curBookId = ref(-1)
const curBookName = ref('')
//当前教材封面图
const curBookImg = ref('')
+//当前教材文件路径
+const curBookPath = ref('')
// 上册
const volumeOne = ref([])
// 下册
@@ -126,10 +128,11 @@ const getSubjectContent = async () => {
}
//选择教材
-const changeBook = ({ id, itemtitle, avartar }) => {
+const changeBook = ({ id, itemtitle, avartar, fileurl }) => {
curBookId.value = id
curBookName.value = itemtitle
curBookImg.value = BaseUrl + avartar
+ curBookPath.value = fileurl
getTreeData()
setTimeout(() => {
dialogVisible.value = false
@@ -176,7 +179,8 @@ const emitChangeBook = () => {
textBook: {
curBookId: curBookId.value,
curBookName: curBookName.value,
- curBookImg: curBookImg.value
+ curBookImg: curBookImg.value,
+ curBookPath: curBookPath.value
},
node: curNode
}
@@ -276,6 +280,7 @@ const getSubject = async () => {
curBookName.value = subjectList.value[0].itemtitle
curBookId.value = subjectList.value[0].id
curBookImg.value = BaseUrl + subjectList.value[0].avartar
+ curBookPath.value = subjectList.value[0].fileurl
}
@@ -291,7 +296,7 @@ const handleNodeClick = (data, node) => {
* data : 当前节点数据
* node : 当前节点对象 包含当前节点所有数据 parent属性 指向父节点Node对象
*/
-
+
const nodeData = data;
const parentNode = node.parent.data;
@@ -306,7 +311,8 @@ const handleNodeClick = (data, node) => {
textBook: {
curBookId: curBookId.value,
curBookName: curBookName.value,
- curBookImg: curBookImg.value
+ curBookImg: curBookImg.value,
+ curBookPath: curBookPath.value
},
node: toRaw(nodeData)
}
@@ -428,4 +434,4 @@ onMounted(() => {
background-color: #eaf3ff !important;
color: #409EFF
}
-
\ No newline at end of file
+
diff --git a/src/renderer/src/components/upload-dialog/index.vue b/src/renderer/src/components/upload-dialog/index.vue
index 4615780..9b06e8d 100644
--- a/src/renderer/src/components/upload-dialog/index.vue
+++ b/src/renderer/src/components/upload-dialog/index.vue
@@ -96,9 +96,9 @@ const hanleFileChange = (file) => {
return false
}
// 验证文件大小
- // B < KB < MB < GB
+ // B < KB < MB < GB
// file.raw.size 单位是B
- const fileSize = file.raw.size / 1024 / 1024 > 100
+ const fileSize = file.raw.size / 1024 / 1024 > 500
if (fileSize) {
ElMessage.error('文件大小错误! 请上传小于100M的文件!')
return false
@@ -126,7 +126,7 @@ const checkFile = (item, file) => {
else{
return false
}
-
+
}
// 删除
diff --git a/src/renderer/src/layout/components/Uploader.vue b/src/renderer/src/layout/components/Uploader.vue
index ce9c275..43ee118 100644
--- a/src/renderer/src/layout/components/Uploader.vue
+++ b/src/renderer/src/layout/components/Uploader.vue
@@ -118,7 +118,7 @@ export default {
file.callback(res)
},
beforeUpload(file) {
- const MAX_SIZE = 100 * 1024 * 1024 // 2MB
+ const MAX_SIZE = 500 * 1024 * 1024 // 2MB
if (file.size > MAX_SIZE) {
this.$message.error('文件大小不能超过 100MB!')
return false
diff --git a/src/renderer/src/store/modules/uploader.js b/src/renderer/src/store/modules/uploader.js
index 445aea6..1f2d01a 100644
--- a/src/renderer/src/store/modules/uploader.js
+++ b/src/renderer/src/store/modules/uploader.js
@@ -17,7 +17,7 @@ const uploaderStore = defineStore('uploader', {
pushFile(payload) {
let _this = this
let arr = payload.filter((item) => {
- const MAX_SIZE = 100 * 1024 * 1024; // 2MB
+ const MAX_SIZE = 500 * 1024 * 1024; // 2MB
if (item.size > MAX_SIZE) {
ElMessage.error('文件大小不能超过 100MB!');
return false;
diff --git a/src/renderer/src/views/prepare/container/reserv.vue b/src/renderer/src/views/prepare/container/reserv.vue
new file mode 100644
index 0000000..1ab31db
--- /dev/null
+++ b/src/renderer/src/views/prepare/container/reserv.vue
@@ -0,0 +1,129 @@
+
+