From fb05f7cd1d442a4c9c1f1be010cfc6bc3b298fcf Mon Sep 17 00:00:00 2001 From: Tuzki <1720599558@qq.com> Date: Wed, 13 Aug 2025 19:28:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(pageIndex):=20=E4=BC=98=E5=8C=96=E4=BA=8B?= =?UTF-8?q?=E6=95=85=E5=88=97=E8=A1=A8=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E3=80=81=E9=99=84=E4=BB=B6=E9=A2=84=E8=A7=88=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8F=8AAI=E9=97=AE=E7=AD=94=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0API=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../verifition/verifyPoint/verifyPoint.vue | 4 +- .../verifition/verifySlider/verifySlider.vue | 4 +- config.js | 7 +-- pageIndex/accident/accident.vue | 63 ++++++++++++++++--- pageIndex/aiAsk/aiAsk.vue | 13 ++-- utils/request.js | 2 +- 6 files changed, 69 insertions(+), 24 deletions(-) diff --git a/components/verifition/verifyPoint/verifyPoint.vue b/components/verifition/verifyPoint/verifyPoint.vue index 57d7d03..c409898 100644 --- a/components/verifition/verifyPoint/verifyPoint.vue +++ b/components/verifition/verifyPoint/verifyPoint.vue @@ -142,7 +142,7 @@ } myRequest({ // url: `/captcha/check`, - url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 + url: '/prod-api/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 data, method:"POST", }).then(result => { @@ -213,7 +213,7 @@ } myRequest({ // url: "/captcha/get", //仅为示例,并非真实接口地址。 - url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 + url: '/prod-api/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 data, method:"POST", }).then((result) => { diff --git a/components/verifition/verifySlider/verifySlider.vue b/components/verifition/verifySlider/verifySlider.vue index 7c75e0e..a17cfb8 100644 --- a/components/verifition/verifySlider/verifySlider.vue +++ b/components/verifition/verifySlider/verifySlider.vue @@ -231,7 +231,7 @@ } myRequest({ // url: `/captcha/check`, - url: '/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 + url: '/prod-api/admin-api/system/captcha/check', // 使用项目自定义的 /admin-api/ 前缀 data, method: "POST", }).then((result) => { @@ -319,7 +319,7 @@ } myRequest({ // url: '/captcha/get', //仅为示例,并非真实接口地址。 - url: '/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 + url: '/prod-api/admin-api/system/captcha/get', // 使用项目自定义的 /admin-api/ 前缀 data, method: "POST", }).then((result) => { diff --git a/config.js b/config.js index 4b9f776..5a66406 100644 --- a/config.js +++ b/config.js @@ -1,10 +1,9 @@ // 应用全局配置 module.exports = { // baseUrl: 'http://api-dashboard.yudao.iocoder.cn', - // baseUrl: 'https://cjy.aitto.net:48081', - baseUrl: 'http://192.168.130.155:8048', - // baseApi: '/prod-api/admin-api', - baseApi: '', + baseUrl: 'https://e629859.r39.cpolar.top', + // baseUrl: 'http://192.168.130.155:8048', + baseApi: '/prod-api', // 应用信息 appInfo: { // 应用名称 diff --git a/pageIndex/accident/accident.vue b/pageIndex/accident/accident.vue index 9290c1c..1db8df9 100644 --- a/pageIndex/accident/accident.vue +++ b/pageIndex/accident/accident.vue @@ -60,11 +60,11 @@ 事故时间 - {{ item.createTime }} + {{ parseTime(item.createTime) }} - - + + 查看附件 @@ -172,16 +172,63 @@ export default { console.log(err) }) }, - getLabelByValue(){ + getLabelByValue() { return getLabelByValue.apply(this, arguments) }, openPop() { this.$refs.popup.open() }, - goFilePage() { - uni.navigateTo({ - url: '/pageIndex/filePage/filePage' - }) + goFilePage(url) { + // 获取文件后缀名 + const fileExtension = url.split(".").pop()?.toLowerCase(); + if (!fileExtension) { + uni.showToast({ title: "无法识别文件类型", icon: "none" }); + return; + } + + // 判断文件类型 + if (["jpg", "jpeg", "png", "gif"].includes(fileExtension)) { + // 图片预览 + uni.previewImage({ + urls: [url], + }); + } else { + // 文档预览 + uni.downloadFile({ + url: url, + // filePath: filePath, + success: (res) => { + + if (res.statusCode === 200) { + uni.openDocument({ + filePath: res.tempFilePath, + success: () => console.log("文档预览成功 路径: ", res.tempFilePath), + + fail: (err) => { + console.error("文档预览失败", err); + uni.showToast({ + title: "预览失败", + icon: "error", + }); + }, + }); + } else { + uni.showToast({ + title: "文件下载失败", + icon: "error", + }); + } + }, + fail: (err) => { + console.error("文件下载失败", err); + uni.showToast({ + title: "文件下载失败", + icon: "error", + }); + }, + }); + } + }, parseTime(time) { return parseTime(time) diff --git a/pageIndex/aiAsk/aiAsk.vue b/pageIndex/aiAsk/aiAsk.vue index 5cdb9ad..667154e 100644 --- a/pageIndex/aiAsk/aiAsk.vue +++ b/pageIndex/aiAsk/aiAsk.vue @@ -21,7 +21,8 @@ {{ msg.content }} - +