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 }} - +