mirror of https://github.com/Xhofe/alist
💚 fix web replace
parent
52ee2e0a8b
commit
641ca67671
|
@ -12,7 +12,7 @@ func InitLog() {
|
||||||
log.SetLevel(log.DebugLevel)
|
log.SetLevel(log.DebugLevel)
|
||||||
log.SetReportCaller(true)
|
log.SetReportCaller(true)
|
||||||
}
|
}
|
||||||
if conf.Password {
|
if conf.Password || conf.Version {
|
||||||
log.SetLevel(log.WarnLevel)
|
log.SetLevel(log.WarnLevel)
|
||||||
}
|
}
|
||||||
log.SetFormatter(&log.TextFormatter{
|
log.SetFormatter(&log.TextFormatter{
|
||||||
|
|
3
build.sh
3
build.sh
|
@ -5,8 +5,9 @@ BUILD_WEB() {
|
||||||
git clone https://github.com/alist-org/alist-web.git
|
git clone https://github.com/alist-org/alist-web.git
|
||||||
cd alist-web
|
cd alist-web
|
||||||
yarn
|
yarn
|
||||||
yarn build --base="CDN_URL"
|
yarn build
|
||||||
sed -i -e "s/\/CDN_URL\//\//g" dist/index.html
|
sed -i -e "s/\/CDN_URL\//\//g" dist/index.html
|
||||||
|
sed -i -e "s/assets/\/assets/g" dist/index.html
|
||||||
rm -f dist/index.html-e
|
rm -f dist/index.html-e
|
||||||
mv dist ..
|
mv dist ..
|
||||||
cd ..
|
cd ..
|
||||||
|
|
|
@ -26,6 +26,7 @@ func InitIndex() {
|
||||||
cdnUrl = strings.TrimRight(cdnUrl, "/")
|
cdnUrl = strings.TrimRight(cdnUrl, "/")
|
||||||
conf.RawIndexHtml = string(data)
|
conf.RawIndexHtml = string(data)
|
||||||
conf.RawIndexHtml = strings.ReplaceAll(conf.RawIndexHtml, "/CDN_URL", cdnUrl)
|
conf.RawIndexHtml = strings.ReplaceAll(conf.RawIndexHtml, "/CDN_URL", cdnUrl)
|
||||||
|
conf.RawIndexHtml = strings.ReplaceAll(conf.RawIndexHtml, "assets/", cdnUrl+"/assets/")
|
||||||
}
|
}
|
||||||
|
|
||||||
func Static(r *gin.Engine) {
|
func Static(r *gin.Engine) {
|
||||||
|
|
Loading…
Reference in New Issue