提交 2f6a0895 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 修改OSS上传地址

上级 edf416e8
...@@ -23,7 +23,7 @@ export function getSignature() { ...@@ -23,7 +23,7 @@ export function getSignature() {
// 图片上传 // 图片上传
export function uploadFile(data: Record<string, any>) { export function uploadFile(data: Record<string, any>) {
return httpRequest return httpRequest
.post('https://webapp-pub.ezijing.com', data, { .post(data.host || 'https://webapp-pub.ezijing.com', data, {
withCredentials: false, withCredentials: false,
headers: { 'Content-Type': 'multipart/form-data' } headers: { 'Content-Type': 'multipart/form-data' }
}) })
......
...@@ -42,6 +42,7 @@ const handleBeforeUpload = async (file: any) => { ...@@ -42,6 +42,7 @@ const handleBeforeUpload = async (file: any) => {
const response: Record<string, any> = await getSignature() const response: Record<string, any> = await getSignature()
uploadData.value = { uploadData.value = {
key, key,
host: response.host,
OSSAccessKeyId: response.accessid, OSSAccessKeyId: response.accessid,
policy: response.policy, policy: response.policy,
signature: response.signature, signature: response.signature,
...@@ -101,7 +102,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => { ...@@ -101,7 +102,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => {
<template> <template>
<el-upload <el-upload
action="https://webapp-pub.ezijing.com" :action="uploadData?.host"
:data="uploadData" :data="uploadData"
:show-file-list="showFileList" :show-file-list="showFileList"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
......
...@@ -20,6 +20,7 @@ const ImageUploadHandler = (blobInfo: any) => ...@@ -20,6 +20,7 @@ const ImageUploadHandler = (blobInfo: any) =>
const { accessid, policy, signature, host } = response const { accessid, policy, signature, host } = response
const params = { const params = {
key, key,
host,
OSSAccessKeyId: accessid, OSSAccessKeyId: accessid,
policy, policy,
signature, signature,
......
...@@ -32,6 +32,7 @@ const handleBeforeUpload = async (file: any) => { ...@@ -32,6 +32,7 @@ const handleBeforeUpload = async (file: any) => {
const response: Record<string, any> = await getSignature() const response: Record<string, any> = await getSignature()
uploadData.value = { uploadData.value = {
key, key,
host: response.host,
OSSAccessKeyId: response.accessid, OSSAccessKeyId: response.accessid,
policy: response.policy, policy: response.policy,
signature: response.signature, signature: response.signature,
...@@ -79,7 +80,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => { ...@@ -79,7 +80,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => {
<template> <template>
<el-upload <el-upload
action="https://webapp-pub.ezijing.com" :action="uploadData?.host"
:data="uploadData" :data="uploadData"
:show-file-list="false" :show-file-list="false"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
......
...@@ -32,6 +32,7 @@ const handleBeforeUpload = async (file: any) => { ...@@ -32,6 +32,7 @@ const handleBeforeUpload = async (file: any) => {
const response: Record<string, any> = await getSignature() const response: Record<string, any> = await getSignature()
uploadData.value = { uploadData.value = {
key, key,
host: response.host,
OSSAccessKeyId: response.accessid, OSSAccessKeyId: response.accessid,
policy: response.policy, policy: response.policy,
signature: response.signature, signature: response.signature,
...@@ -79,7 +80,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => { ...@@ -79,7 +80,7 @@ const handlePreview: UploadProps['onPreview'] = uploadFile => {
<template> <template>
<el-upload <el-upload
action="https://webapp-pub.ezijing.com" :action="uploadData?.host"
:data="uploadData" :data="uploadData"
:show-file-list="false" :show-file-list="false"
:before-upload="handleBeforeUpload" :before-upload="handleBeforeUpload"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论