Commit 6980fdac by lijiabin

【需求 22051】 chore: 修改相关链接 防止跨域

parent 90448c83
......@@ -5,7 +5,7 @@ import { storeToRefs } from 'pinia'
import type { UploadFileResponseItem, ChunkCheckResponse } from './types'
// 'https://oa.yswg.com.cn:8085'
const OA_UPLOAD_CHUNK_BASE_URL = 'https://nas1.yswg.top:8088'
export const OA_UPLOAD_CHUNK_BASE_URL = 'https://nas1.yswg.top:8088'
const OA_UPLOAD_COMMON_BASE_URL = 'http://47.112.96.71:8082'
const CHUNK_UPLOAD_THRESHOLD = 10 * 1024 * 1024
const CHUNK_SIZE = 5 * 1024 * 1024
......
......@@ -385,7 +385,7 @@
import UploadVideo from '@/components/common/UploadVideo/index.vue'
import { useResetData } from '@/hooks'
import { ArticleTypeEnum, ReleaseStatusTypeEnum, SendTypeEnum, BooleanFlag } from '@/constants'
import { addOrUpdateArticle, uploadFile, getArticleDetail } from '@/api'
import { addOrUpdateArticle, uploadFile, getArticleDetail, OA_UPLOAD_CHUNK_BASE_URL } from '@/api'
import SelectTags from '@/components/common/SelectTags/index.vue'
import type { TagItemDto, AddOrUpdateVideoDto } from '@/api'
import { useVideoStore, useUserStore } from '@/stores'
......@@ -634,7 +634,7 @@ const handleVideoChange = ({
url: string
videoDuration: string
}) => {
locationVideoBlolUrl.value = form.value.videoUrl
locationVideoBlolUrl.value = parseUrl(form.value.videoUrl)
form.value.videoDuration = videoDuration
}
......@@ -647,6 +647,12 @@ const handleFileChange = async (e: Event) => {
const data = await promise
form.value.faceUrl = data.filePath
}
// 防止跨域
const parseUrl = (url: string) => {
return OA_UPLOAD_CHUNK_BASE_URL + '/oa/nfs' + new URL(url).pathname.replace('/database', '')
}
onDeactivated(() => {
// 清空页面的数据
resetPageData()
......@@ -658,7 +664,7 @@ onActivated(async () => {
if (route.query.id) {
const { data } = await getArticleDetail(route.query.id as string)
locationVideoBlolUrl.value = data.videoUrl
locationVideoBlolUrl.value = parseUrl(data.videoUrl)
form.value = {
...form.value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment