Skip to content

Commit

Permalink
💚 fix web replace
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Feb 21, 2022
1 parent 52ee2e0 commit 641ca67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bootstrap/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func InitLog() {
log.SetLevel(log.DebugLevel)
log.SetReportCaller(true)
}
if conf.Password {
if conf.Password || conf.Version {
log.SetLevel(log.WarnLevel)
}
log.SetFormatter(&log.TextFormatter{
Expand Down
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ BUILD_WEB() {
git clone https://github.com/alist-org/alist-web.git
cd alist-web
yarn
yarn build --base="CDN_URL"
yarn build
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
mv dist ..
cd ..
Expand Down
1 change: 1 addition & 0 deletions server/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func InitIndex() {
cdnUrl = strings.TrimRight(cdnUrl, "/")
conf.RawIndexHtml = string(data)
conf.RawIndexHtml = strings.ReplaceAll(conf.RawIndexHtml, "/CDN_URL", cdnUrl)
conf.RawIndexHtml = strings.ReplaceAll(conf.RawIndexHtml, "assets/", cdnUrl+"/assets/")
}

func Static(r *gin.Engine) {
Expand Down

0 comments on commit 641ca67

Please sign in to comment.