mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	文档对话不显示文档列表的 bug
This commit is contained in:
		@@ -1,5 +1,5 @@
 | 
			
		||||
# 前端 Vue 项目构建
 | 
			
		||||
FROM registry.cn-shenzhen.aliyuncs.com/geekmaster/nginx:latest
 | 
			
		||||
FROM registry.cn-hangzhou.aliyuncs.com/geekmaster/nginx:1.20.2
 | 
			
		||||
 | 
			
		||||
MAINTAINER yangjian<yangjian102621@163.com>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
# 前端 Vue 项目构建
 | 
			
		||||
FROM registry.cn-hangzhou.aliyuncs.com/geekmaster/nginx:1.20.2
 | 
			
		||||
FROM registry.cn-shenzhen.aliyuncs.com/geekmaster/nginx:latest
 | 
			
		||||
 | 
			
		||||
MAINTAINER yangjian<yangjian102621@163.com>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -142,20 +142,30 @@ const processFiles = () => {
 | 
			
		||||
 | 
			
		||||
  const linkRegex = /(https?:\/\/\S+)/g;
 | 
			
		||||
  const links = props.data.content.match(linkRegex);
 | 
			
		||||
  const urlPrefix = `${window.location.protocol}//${window.location.host}`;
 | 
			
		||||
  if (links) {
 | 
			
		||||
    httpPost("/api/upload/list", {urls: links}).then(res => {
 | 
			
		||||
      files.value = res.data.items
 | 
			
		||||
 | 
			
		||||
      for (let link of links) {
 | 
			
		||||
        if (isExternalImg(link, files.value)) {
 | 
			
		||||
          files.value.push({url:link, ext: ".png"})
 | 
			
		||||
        }
 | 
			
		||||
    const _links = links.map((link) => {
 | 
			
		||||
      if (link.startsWith(urlPrefix)) {
 | 
			
		||||
        return link.replace(urlPrefix, "");
 | 
			
		||||
      }
 | 
			
		||||
    }).catch(() => {
 | 
			
		||||
    })
 | 
			
		||||
      return link;
 | 
			
		||||
    });
 | 
			
		||||
    // 合并数组并去重
 | 
			
		||||
    const urls = [...new Set([...links, ..._links])];
 | 
			
		||||
    httpPost("/api/upload/list", { urls: urls })
 | 
			
		||||
        .then((res) => {
 | 
			
		||||
          files.value = res.data.items;
 | 
			
		||||
 | 
			
		||||
          for (let link of links) {
 | 
			
		||||
            if (isExternalImg(link, files.value)) {
 | 
			
		||||
              files.value.push({ url: link, ext: ".png" });
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
        .catch(() => {});
 | 
			
		||||
 | 
			
		||||
    for (let link of links) {
 | 
			
		||||
      content.value = content.value.replace(link,"")
 | 
			
		||||
      content.value = content.value.replace(link, "");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user