From fb34ed582f9e16f0d3f6f6c001c717c6ad2f7b61 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Thu, 2 Jan 2025 23:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/user/visualization.vue | 9 ++++++--- config.js | 17 +++++++++++++++++ manifest.json | 4 ++++ utils/oss-upload/oss/index.js | 21 +++++++++++++-------- 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/components/user/visualization.vue b/components/user/visualization.vue index 8f95aac..c3ff4d7 100644 --- a/components/user/visualization.vue +++ b/components/user/visualization.vue @@ -120,9 +120,12 @@ let data = res.result + data.length = 4 - this.dates = data[0].map(n => this.$dayjs(n.priceDate) - .format('MM-DD')) + for(let i = 0;i < data.length;i++){ + this.dates.push(data[i].map(n => this.$dayjs(n.priceDate) + .format('MM-DD'))) + } this.series.forEach((s, i) => { if(data[i]){ @@ -183,7 +186,7 @@ }, xAxis: { type: 'category', - data: this.dates, + data: this.dates[this.index], axisLine: { lineStyle: { color: '#fff' diff --git a/config.js b/config.js index 97b1ce5..dcf59bc 100644 --- a/config.js +++ b/config.js @@ -24,6 +24,7 @@ const config = { // 默认配置 const defaultConfig = { mapKey : 'JYTBZ-DOY3Q-UCM5O-4FWQR-LCI7S-ZIBD3', + aliOss: { url: 'https://image.hhlm1688.com/', config: { @@ -40,6 +41,22 @@ const defaultConfig = { }, + // aliOss : { + // url : 'https://tennis-oss.xzaiyp.top/', + // config : { + // //桶的地址 + // region: 'oss-cn-guangzhou', + // //id + // accessKeyId:'LTAI5tNycA46YTwm383dRvMV', + // //密钥 + // accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG', + // //桶的名字 + // bucket: 'zhuoqiu-image', + // endpoint:'oss-cn-guangzhou.aliyuncs.com', + // } + // }, + + // aliOss : { // url : 'https://image.hhlm1688.com/', // config : { diff --git a/manifest.json b/manifest.json index 9447a6b..08c942e 100644 --- a/manifest.json +++ b/manifest.json @@ -98,6 +98,10 @@ "/ws/location/v1/" : { "target" : "https://apis.map.qq.com", "changeOrigin" : true + }, + "/oss" : { + "target" : "https://image.hhlm1688.com/", + "changeOrigin" : true } } } diff --git a/utils/oss-upload/oss/index.js b/utils/oss-upload/oss/index.js index c013e5e..ff55169 100644 --- a/utils/oss-upload/oss/index.js +++ b/utils/oss-upload/oss/index.js @@ -57,6 +57,7 @@ export function ossUpload(filePath, key = storeKey(), folder = storeFolder()) { const filePrefixArr = filePath.split(".") key += `.${filePrefixArr[filePrefixArr.length - 1]}` let config = { + // url: '/oss', url: OSSConfig.host, name: 'file', filePath, @@ -100,10 +101,12 @@ export function ossUploadImage({ count: 1, sizeType, success(res) { - // #ifdef H5 - return uploadFileToOSS(res.tempFiles[0]).then(success).catch(fail) - // #endif - ossUpload(res.tempFilePaths[0], key, folder).then(success).catch(fail) + // // #ifdef H5 + // return uploadFileToOSS(res.tempFiles[0]).then(success).catch(fail) + // // #endif + // ossUpload(res.tempFilePaths[0], key, folder).then(success).catch(fail) + + uploadFileToOSS(res.tempFile).then(success).catch(fail) }, fail }) @@ -130,10 +133,12 @@ export function ossUploadVideo({ maxDuration, camera, success(res) { - // #ifdef H5 - return uploadFileToOSS(res.tempFile).then(success).catch(fail) - // #endif - ossUpload(res.tempFilePath, key, folder).then(success).catch(fail) + // // #ifdef H5 + // return uploadFileToOSS(res.tempFile).then(success).catch(fail) + // // #endif + // ossUpload(res.tempFilePath, key, folder).then(success).catch(fail) + + uploadFileToOSS(res.tempFile).then(success).catch(fail) }, fail })