fix: 🧩 修复富文本编辑器视频上传限制(150M)

This commit is contained in:
2025-08-26 17:27:49 +08:00
parent 29d6ba59c9
commit 0dab4cc524
8 changed files with 37 additions and 21 deletions

BIN
dist.zip

Binary file not shown.

Binary file not shown.

View File

@@ -89,7 +89,6 @@ class RequestHttp {
// 可以在这里更新用户的 token 信息 // 可以在这里更新用户的 token 信息
const userStore = useUserStore(); const userStore = useUserStore();
userStore.setToken(authorization); userStore.setToken(authorization);
console.log("123232323");
return data; return data;
} }

View File

@@ -177,7 +177,7 @@ const currentEditingTabsRef = ref(null);
const props = defineProps({ const props = defineProps({
content: { type: String, default: "" }, content: { type: String, default: "" },
readOnly: { type: Boolean, default: false }, readOnly: { type: Boolean, default: false },
fileSizeLimit: { type: Number, default: 10 } fileSizeLimit: { type: Number, default: 5 }
}); });
// 主编辑器内容双向绑定 // 主编辑器内容双向绑定
@@ -456,13 +456,14 @@ const handleVideoUpload = async evt => {
const file = evt.target.files[0]; const file = evt.target.files[0];
// 1. 校验视频文件 // 1. 校验视频文件
const maxSize = props.fileSizeLimit * 1024 * 1024 * 15; const maxSize = 150 * 1024 * 1024;
if (file.size > maxSize) { if (file.size > maxSize) {
ElNotification({ ElNotification({
title: "文件过大", title: "文件过大",
message: `视频大小不能超过 ${props.fileSizeLimit}MB`, message: `视频大小不能超过 ${150}MB`,
type: "warning" type: "warning"
}); });
evt.target.value = "";
return; return;
} }

View File

@@ -53,7 +53,7 @@ const videoShowUrl = ref<any>(null);
const props = withDefaults(defineProps<UploadFileProps>(), { const props = withDefaults(defineProps<UploadFileProps>(), {
videoUrl: "", videoUrl: "",
disabled: false, disabled: false,
fileSize: 200, fileSize: 150,
width: "400px", width: "400px",
fileType: () => [".mp4", ".avi", ".mov", "video/mp4", "video/mov", "video/avi"], fileType: () => [".mp4", ".avi", ".mov", "video/mp4", "video/mov", "video/avi"],
borderRadius: "8px" borderRadius: "8px"

View File

@@ -46,13 +46,13 @@ import { ElMessageBox } from "element-plus";
import { outLogin } from "@/utils/outLogin"; import { outLogin } from "@/utils/outLogin";
import { useKeepAliveStore } from "@/stores/modules/keepAlive"; import { useKeepAliveStore } from "@/stores/modules/keepAlive";
import { getLanguageListApi, getLanguageCutoverApi } from "@/api/modules/global"; import { getLanguageListApi, getLanguageCutoverApi } from "@/api/modules/global";
// import { HOME_URL } from "@/config"; import { HOME_URL } from "@/config";
// import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useTabsStore } from "@/stores/modules/tabs"; import { useTabsStore } from "@/stores/modules/tabs";
const tabStore = useTabsStore(); const tabStore = useTabsStore();
const userStore = useUserStore(); const userStore = useUserStore();
// const router = useRouter(); const router = useRouter();
const keepAliveStore = useKeepAliveStore(); const keepAliveStore = useKeepAliveStore();
document.cookie = `lang=zh_cn`; document.cookie = `lang=zh_cn`;
const langs = ref<any>([]); const langs = ref<any>([]);
@@ -80,9 +80,19 @@ const getLanguageCutover = async (id: any, type: any) => {
}); });
name.value = names[0]?.country_name; name.value = names[0]?.country_name;
if (type === "click") { if (type === "click") {
tabStore.closeMultipleTab("/admin/index"); tabStore.setTabs([
{
icon: "",
title: "首页",
path: "/admin/index",
name: "home",
close: true
}
]);
keepAliveStore.setKeepAliveName(); keepAliveStore.setKeepAliveName();
router.push(HOME_URL); setTimeout(() => {
router.push(HOME_URL);
}, 500);
} }
} }
}; };
@@ -97,14 +107,6 @@ const handleCommand = (val: string) => {
type: "warning" type: "warning"
}).then(async () => { }).then(async () => {
await getLanguageCutover(val, "click"); await getLanguageCutover(val, "click");
// // // 1. 退出登录
// // const result: any = await logoutApi();
// // if (result?.code === 0) {
// // getLanguageCutover(val);
// // // outLogin();
// // } else {
// // useMsg("error", result.message);
// // }
}); });
}; };

View File

@@ -86,9 +86,23 @@ const closeOtherTab = () => {
// Close All // Close All
const closeAllTab = () => { const closeAllTab = () => {
tabStore.closeMultipleTab(); tabStore.setTabs([
{
icon: "",
title: "首页",
path: "/admin/index",
name: "home",
close: true
}
]);
keepAliveStore.setKeepAliveName(); keepAliveStore.setKeepAliveName();
router.push(HOME_URL); setTimeout(() => {
router.push(HOME_URL);
}, 500);
// tabStore.closeMultipleTab();
// keepAliveStore.setKeepAliveName();
// router.push(HOME_URL);
}; };
</script> </script>

View File

@@ -45,7 +45,7 @@ const keepAliveStore = useKeepAliveStore();
const tabsMenuValue = ref(route.fullPath); const tabsMenuValue = ref(route.fullPath);
const tabsMenuList = computed(() => tabStore.tabsMenuList); const tabsMenuList = computed(() => tabStore.tabsMenuList);
console.log(tabStore.tabsMenuList, "===============value================");
onMounted(() => { onMounted(() => {
tabsDrop(); tabsDrop();
initTabs(); initTabs();