From 41ff23e97edb3b5c182d7444892009bfefc11e6c Mon Sep 17 00:00:00 2001 From: zhuyiyi <649091362@qq.com> Date: Wed, 5 Nov 2025 15:18:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9oss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileUpload/index.vue | 12 ++++++------ src/router/index.js | 3 +++ src/views/info.vue | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index 2f20a20..276a491 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -55,7 +55,7 @@ - Preview Image + Preview Image @@ -78,7 +78,7 @@ const props = defineProps({ const emit = defineEmits(); const uploadList = ref([]); -const baseUrl = "https://dfdiyfile.oss-cn-fuzhou.aliyuncs.com/"; +const baseUrl = "https://ltcloudfile.oss-cn-hangzhou.aliyuncs.com/"; const fileList = ref([]); const dialogImageUrl = ref(""); const dialogVisible = ref(false); @@ -241,13 +241,13 @@ function handleChange(file, fileList) { let fileDir = dayjs().format("YYYYMMDD"); const client = new OSS({ // yourregion填写Bucket所在地域。以华东1(杭州)为例,Region填写为oss-cn-hangzhou。 - region: "oss-cn-fuzhou", + region: "oss-cn-hangzhou", // 从环境变量中获取访问凭证。运行本代码示例之前,请确保已设置环境变量OSS_ACCESS_KEY_ID和OSS_ACCESS_KEY_SECRET。 accessKeyId: process.env.VUE_APP_OSS_ACCESS_KEY_ID, accessKeySecret: process.env.VUE_APP_OSS_ACCESS_KEY_SECRET, // 填写存储空间名称。 - bucket: "dfdiyfile", - endpoint: "https://oss-cn-fuzhou.aliyuncs.com", + bucket: "ltcloudfile", + endpoint: "https://oss-cn-hangzhou.aliyuncs.com", }); let name = "desgn/" + fileDir + "/" + guid() + getSuff(file.name); // storeAs表示上传的object name , file表示上传的文件 @@ -257,7 +257,7 @@ function handleChange(file, fileList) { }) .then((result) => { console.log(result); - let url = `https://dfdiyfile.oss-cn-fuzhou.aliyuncs.com/${result.name}`; + let url = `https://ltcloudfile.oss-cn-hangzhou.aliyuncs.com/${result.name}`; /** * 设置本地上传成功的回调 */ diff --git a/src/router/index.js b/src/router/index.js index 5555c9f..235addc 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,6 +3,9 @@ const routes = [ { path: "/", component: () => import("@/views/info"), + },{ + path: "/invoice", + component: () => import("@/views/invoice"), }, ]; diff --git a/src/views/info.vue b/src/views/info.vue index 119da3b..9469870 100644 --- a/src/views/info.vue +++ b/src/views/info.vue @@ -54,7 +54,7 @@ import { getFormData, saveFormData } from "../api/index"; import { useRouter } from "vue-router"; import { ElMessage } from "element-plus"; import { handleBatchDownload } from "../utils/downFile"; -const baseUrl = "https://dfdiyfile.oss-cn-fuzhou.aliyuncs.com/"; +const baseUrl = "https://ltcloudfile.oss-cn-hangzhou.aliyuncs.com/"; import { ref } from "vue"; import FileUpload from "../components/FileUpload/index"; const { currentRoute } = useRouter();