fix:相关漏洞修复

This commit is contained in:
weiwei committed 2025-08-15 15:55:02 +08:00
1 parent 0e66d461a7
commit 766bdea32a
6 files changed
+370 -294

No files matched your search

+80 -80
View File
@@ -133,117 +133,117 @@
</template>
<script setup lang="ts" name="wx-material">
import {fetchAccountList} from '/@/api/mp/wx-account';
import {useMessage, useMessageBox} from '/@/hooks/message';
import {BasicTableProps, useTable} from '/@/hooks/table';
import {delObj, getMaterialOther, getMaterialVideo, getPage} from '/@/api/mp/wx-material';
import { fetchAccountList } from "/@/api/mp/wx-account"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { BasicTableProps, useTable } from "/@/hooks/table"
import { delObj, getMaterialOther, getMaterialVideo, getPage } from "/@/api/mp/wx-material"
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'));
const NewsForm = defineAsyncComponent(() => import('./components/news-form.vue'));
const WxFileUpload = defineAsyncComponent(() => import('/@/components/Wechat/fileUpload/index.vue'));
const WxNews = defineAsyncComponent(() => import('/@/components/Wechat/wx-news/index.vue'));
const QueryTree = defineAsyncComponent(() => import("/@/components/QueryTree/index.vue"))
const NewsForm = defineAsyncComponent(() => import("./components/news-form.vue"))
const WxFileUpload = defineAsyncComponent(() => import("/@/components/Wechat/fileUpload/index.vue"))
const WxNews = defineAsyncComponent(() => import("/@/components/Wechat/wx-news/index.vue"))
const deptData = reactive({
queryList: (name?: string) => {
return fetchAccountList({
name: name,
});
})
},
});
})
const checkAppId = ref();
const checkAppId = ref()
const uploadData = ref({
appId: '',
mediaType: 'image',
title: '',
introduction: '',
});
appId: "",
mediaType: "image",
title: "",
introduction: "",
})
const materialType = ref('image');
const materialType = ref("image")
// 点击树
const handleNodeClick = (data: any) => {
checkAppId.value = data.appid;
uploadData.value.appId = data.appid;
state.queryForm.appId = data.appid;
state.queryForm.type = materialType.value;
getDataList();
};
checkAppId.value = data.appid
uploadData.value.appId = data.appid
state.queryForm.appId = data.appid
state.queryForm.type = materialType.value
getDataList()
}
const handleClick = (tab) => {
if (checkAppId.value) {
// getPage(this.page)
} else {
useMessage().error('请选择公众号');
useMessage().error("请选择公众号")
}
materialType.value = tab.paneName;
uploadData.value.mediaType = tab.paneName;
state.queryForm.type = materialType.value;
getDataList();
};
materialType.value = tab.paneName
uploadData.value.mediaType = tab.paneName
state.queryForm.type = materialType.value
getDataList()
}
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
appId: '',
type: '',
appId: "",
type: "",
},
pageList: getPage,
createdIsNeed: false,
props: {
item: 'items',
totalCount: 'totalCount',
item: "items",
totalCount: "totalCount",
},
});
})
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state);
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
const delMaterial = (item: any) => {
useMessageBox()
.confirm('此操作将永久删除该文件, 是否继续?')
.confirm("此操作将永久删除该文件, 是否继续?")
.then(() => {
delObj({
id: item.mediaId,
appId: checkAppId.value,
})
.then(() => {
getDataList();
getDataList()
})
.catch((err) => {
useMessage().error(err.msg);
});
});
};
useMessage().error(err.msg)
})
})
}
// 视频
const dialogVideoVisible = ref(false);
const dialogVideoVisible = ref(false)
const addMaterialLoading = ref(false);
const addMaterialLoading = ref(false)
const handleAddVideo = () => {
dialogVideoVisible.value = true;
};
dialogVideoVisible.value = true
}
const uploadRules = reactive({
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
introduction: [{ required: true, message: '请输入描述', trigger: 'blur' }],
});
title: [{ required: true, message: "请输入标题", trigger: "blur" }],
introduction: [{ required: true, message: "请输入描述", trigger: "blur" }],
})
const uploadForm = ref();
const uploadForm = ref()
const uploadFileVideo = ref();
const uploadFileVideo = ref()
const subVideo = () => {
uploadForm.value.validate((valid: boolean) => {
if (!valid) {
return false;
return false
}
uploadFileVideo.value.submit().then(() => {
dialogVideoVisible.value = false;
});
});
};
dialogVideoVisible.value = false
})
})
}
const handleDown = (row: any) => {
getMaterialOther({
@@ -251,25 +251,25 @@ const handleDown = (row: any) => {
fileName: row.name,
appId: checkAppId.value,
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.style.display = 'none';
link.href = url;
link.setAttribute('download', row.name);
document.body.appendChild(link);
link.click();
});
};
const url = window.URL.createObjectURL(new Blob([response.data]))
const link = document.createElement("a")
link.style.display = "none"
link.href = url
link.setAttribute("download", row.name)
document.body.appendChild(link)
link.click()
})
}
// 图文
const dialogNewsRef = ref();
const dialogNewsRef = ref()
const handleAddNews = () => {
dialogNewsRef.value.openDialog({
accountId: checkAppId.value,
});
};
})
}
const handleEditNews = (item) => {
dialogNewsRef.value.openDialog(
@@ -278,9 +278,9 @@ const handleEditNews = (item) => {
},
JSON.parse(JSON.stringify(item.content.newsItem)),
item.mediaId,
'edit'
);
};
"edit",
)
}
const handleInfo = (row) => {
getMaterialVideo({
@@ -288,21 +288,21 @@ const handleInfo = (row) => {
appId: checkAppId.value,
})
.then((response) => {
const downUrl = response.data.downUrl;
window.open(downUrl, '_blank');
// const downUrl = response.data.downUrl
// window.open(downUrl, '_blank');
})
.catch((err) => {
useMessage().error(err.msg);
});
};
useMessage().error(err.msg)
})
}
// 默认选择第一个公众号
onMounted(async () => {
const { data } = await deptData.queryList();
if (data?.length > 0) {
handleNodeClick(data[0]);
}
});
const { data } = await deptData.queryList()
if (data?.length > 0) {
handleNodeClick(data[0])
}
})
</script>
<style lang="scss" scoped>