mirror of https://github.com/Xhofe/alist
🎇 close #512 favicon redirect
parent
bef3d2f88d
commit
4f81735af6
|
@ -74,7 +74,7 @@ func InitSettings() {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Key: "music cover",
|
Key: "music cover",
|
||||||
Value: "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png",
|
Value: "https://cdn.jsdelivr.net/gh/alist-org/logo@main/circle_center.svg",
|
||||||
Description: "music cover image",
|
Description: "music cover image",
|
||||||
Type: "string",
|
Type: "string",
|
||||||
Access: model.PUBLIC,
|
Access: model.PUBLIC,
|
||||||
|
|
|
@ -78,7 +78,7 @@ var (
|
||||||
"check parent folder", "check down link", "WebDAV username", "WebDAV password",
|
"check parent folder", "check down link", "WebDAV username", "WebDAV password",
|
||||||
"Visitor WebDAV username", "Visitor WebDAV password",
|
"Visitor WebDAV username", "Visitor WebDAV password",
|
||||||
"default page size", "load type",
|
"default page size", "load type",
|
||||||
"ocr api",
|
"ocr api", "favicon",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ func LoadSettings() {
|
||||||
favicon, err := GetSettingByKey("favicon")
|
favicon, err := GetSettingByKey("favicon")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
//conf.Favicon = favicon.Value
|
//conf.Favicon = favicon.Value
|
||||||
conf.ManageHtml = strings.Replace(conf.RawIndexHtml, "https://store.heytapimage.com/cdo-portal/feedback/202110/30/d43c41c5d257c9bc36366e310374fb19.png", favicon.Value, 1)
|
conf.ManageHtml = strings.Replace(conf.RawIndexHtml, "https://cdn.jsdelivr.net/gh/alist-org/logo@main/logo.svg", favicon.Value, 1)
|
||||||
}
|
}
|
||||||
title, err := GetSettingByKey("title")
|
title, err := GetSettingByKey("title")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package controllers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/Xhofe/alist/conf"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Favicon(c *gin.Context) {
|
||||||
|
c.Redirect(302, conf.GetStr("favicon"))
|
||||||
|
}
|
|
@ -15,6 +15,7 @@ func InitApiRouter(r *gin.Engine) {
|
||||||
Cors(r)
|
Cors(r)
|
||||||
r.GET("/d/*path", middlewares.DownCheck, controllers.Down)
|
r.GET("/d/*path", middlewares.DownCheck, controllers.Down)
|
||||||
r.GET("/p/*path", middlewares.DownCheck, controllers.Proxy)
|
r.GET("/p/*path", middlewares.DownCheck, controllers.Proxy)
|
||||||
|
r.GET("/favicon.ico", controllers.Favicon)
|
||||||
|
|
||||||
api := r.Group("/api")
|
api := r.Group("/api")
|
||||||
public := api.Group("/public")
|
public := api.Group("/public")
|
||||||
|
|
Loading…
Reference in New Issue