master
lion 8 months ago
parent 4583c43447
commit f66d5dc446

@ -13,7 +13,7 @@
</template>
<template v-slot:company_ids>
<div class="xy-table-item">
<div class="xy-table-item-label">活动关联方:</div>
<div class="xy-table-item-label">活动关联方2:</div>
<div class="xy-table-item-content">
<Button
type="primary"
@ -894,8 +894,12 @@ export default {
sort:this.form.sort,
content: (() => {
let content = this.form.content || ''
// 跟 request.js 保持一致:本地用 VUE_APP_BASE_API,线上用当前域名
const runtimeBase = window.location.origin.indexOf('localhost') > -1
? (process.env.VUE_APP_BASE_API || '')
: (window.location.origin + '/')
// 去掉末尾的 /,避免出现 //storage/files
const apiBase = (process.env.VUE_APP_BASE_API || '').replace(/\/$/, '')
const apiBase = runtimeBase.replace(/\/$/, '')
const baseUrl = `${apiBase}/storage/files/`
// 只处理 img 标签中 src 以 /storage/files 或 ../storage/files 开头、且不是 http(s) 开头的情况
content = content.replace(
@ -952,7 +956,10 @@ export default {
sort:this.form.sort,
content: (() => {
let content = this.form.content || ''
const apiBase = (process.env.VUE_APP_BASE_API || '').replace(/\/$/, '')
const runtimeBase = window.location.origin.indexOf('localhost') > -1
? (process.env.VUE_APP_BASE_API || '')
: (window.location.origin + '/')
const apiBase = runtimeBase.replace(/\/$/, '')
const baseUrl = `${apiBase}/storage/files/`
content = content.replace(
/(<img[^>]+src=["'])(?:\.\.\/)?\/?storage\/files\/([^"']+)(["'][^>]*>)/g,

@ -602,8 +602,12 @@
end_time: this.form.time[1],
content: (() => {
let content = this.form.content || ''
// 跟 request.js 保持一致:本地用 VUE_APP_BASE_API,线上用当前域名
const runtimeBase = window.location.origin.indexOf('localhost') > -1
? (process.env.VUE_APP_BASE_API || '')
: (window.location.origin + '/')
// 去掉末尾的 /,避免出现 //storage/files
const apiBase = (process.env.VUE_APP_BASE_API || '').replace(/\/$/, '')
const apiBase = runtimeBase.replace(/\/$/, '')
const baseUrl = `${apiBase}/storage/files/`
// 只处理 img 标签中 src 以 /storage/files 或 ../storage/files 开头的情况
content = content.replace(
@ -650,7 +654,10 @@
end_time: this.form.time[1],
content: (() => {
let content = this.form.content || ''
const apiBase = (process.env.VUE_APP_BASE_API || '').replace(/\/$/, '')
const runtimeBase = window.location.origin.indexOf('localhost') > -1
? (process.env.VUE_APP_BASE_API || '')
: (window.location.origin + '/')
const apiBase = runtimeBase.replace(/\/$/, '')
const baseUrl = `${apiBase}/storage/files/`
content = content.replace(
/(<img[^>]+src=["'])(?:\.\.\/)?\/?storage\/files\/([^"']+)(["'][^>]*>)/g,
@ -757,6 +764,4 @@
top: 1px;
left: 4%;
}
</style>
</style>
Loading…
Cancel
Save