From bb67aaf5a671f12b01132c6924c1b9970a33f2a6 Mon Sep 17 00:00:00 2001 From: Sun <95302870@qq.com> Date: Thu, 28 Dec 2023 19:58:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0v1.2.1=20Squashed=20commit=20?= =?UTF-8?q?of=20the=20following:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit 146f106fbece251606f358141bda3d9c524c3e93 Author: Sun <95302870@qq.com> Date: Thu Dec 28 19:39:36 2023 +0800 修改默认宽度 commit 827197e295b2b0997902b8f965d14ab2598c5c1b Author: Sun <95302870@qq.com> Date: Thu Dec 28 17:54:25 2023 +0800 修复升级掉登录的问题 commit 2e54326f5fe2b8fac4eed488a14b04b8133c41bb Author: Sun <95302870@qq.com> Date: Thu Dec 28 17:21:49 2023 +0800 优化边距等提示 commit 469c6fd644a2a23d96405d15456980edfdfb17b0 Author: Sun <95302870@qq.com> Date: Thu Dec 28 17:21:34 2023 +0800 搜索栏选择搜索引擎后关闭选择器 commit 632da9635a4a434d361495dfcb83f8b650cb4a3c Author: Sun <95302870@qq.com> Date: Thu Dec 28 16:54:28 2023 +0800 增加 内容左右边距和最大宽度 commit f1cc3dce2a51ec60c1b04f21954b99b284b2df61 Author: Sun <95302870@qq.com> Date: Thu Dec 28 14:24:23 2023 +0800 分组标题增加阴影 commit 7615a29678037362c18632f38caad72e07a32d1a Author: Sun <95302870@qq.com> Date: Thu Dec 28 14:18:41 2023 +0800 更改版本号1.2.1 commit b605374e951d3fb2ca52d36bd0fa82aec4a5e89b Author: Sun <95302870@qq.com> Date: Thu Dec 28 14:11:06 2023 +0800 优化小部分网站图标获取失败的问题 commit c8141184a14fb02f941bbec03ac98f59f8b12d4b Author: Sun <95302870@qq.com> Date: Thu Dec 28 13:00:56 2023 +0800 优化上传管理界面 --- service/assets/version | 2 +- service/lib/siteFavicon/favico.go | 18 ++++++-- src/components/apps/Style/index.vue | 46 ++++++++++++++----- .../apps/UploadFileManager/index.vue | 12 +++-- src/components/deskModule/SearchBox/index.vue | 1 + src/locales/zh-CN.ts | 2 + src/store/modules/auth/helper.ts | 2 +- src/store/modules/panel/helper.ts | 3 ++ src/typings/panel.d.ts | 3 ++ src/views/home/index.vue | 12 +++-- 10 files changed, 75 insertions(+), 26 deletions(-) diff --git a/service/assets/version b/service/assets/version index 7ceb0f5..58ba41a 100644 --- a/service/assets/version +++ b/service/assets/version @@ -1 +1 @@ -7|1.2.0 \ No newline at end of file +8|1.2.1 \ No newline at end of file diff --git a/service/lib/siteFavicon/favico.go b/service/lib/siteFavicon/favico.go index 83e4e22..bc69f4a 100644 --- a/service/lib/siteFavicon/favico.go +++ b/service/lib/siteFavicon/favico.go @@ -2,7 +2,6 @@ package siteFavicon import ( "errors" - "fmt" "net/http" "net/url" "regexp" @@ -13,7 +12,7 @@ import ( ) func IsHTTPURL(url string) bool { - httpPattern := `^(http://|https://)` + httpPattern := `^(http://|https://|//)` match, err := regexp.MatchString(httpPattern, url) if err != nil { return false @@ -24,7 +23,6 @@ func IsHTTPURL(url string) bool { func GetOneFaviconURL(urlStr string) (string, bool) { iconURLs, err := getFaviconURL(urlStr) if err != nil { - fmt.Println("Error:", err) return "", false } @@ -44,10 +42,20 @@ func GetOneFaviconURL(urlStr string) (string, bool) { func getFaviconURL(url string) ([]string, error) { var icons []string icons = make([]string, 0) - resp, err := http.Get(url) + client := &http.Client{} + req, err := http.NewRequest("GET", url, nil) if err != nil { return icons, err } + + // 设置User-Agent头字段,模拟浏览器请求 + req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3") + + resp, err := client.Do(req) + if err != nil { + return icons, err + } + defer resp.Body.Close() if resp.StatusCode != http.StatusOK { @@ -71,7 +79,7 @@ func getFaviconURL(url string) ([]string, error) { }) if len(icons) == 0 { - return icons, fmt.Errorf("favicon not found on the page") + return icons, errors.New("favicon not found on the page") } return icons, nil diff --git a/src/components/apps/Style/index.vue b/src/components/apps/Style/index.vue index 9c890fa..aee4034 100644 --- a/src/components/apps/Style/index.vue +++ b/src/components/apps/Style/index.vue @@ -1,7 +1,7 @@