feat: update build issues

This commit is contained in:
yanghao05
2025-04-28 19:23:03 +08:00
parent 685c87207f
commit d16e0b56af
5 changed files with 96 additions and 5 deletions

View File

@@ -115,7 +115,13 @@ func Serve(cmd *cobra.Command, args []string) error {
if f == "/" {
f = "index.html"
}
file, err := fabfile.Find(filepath.Join("frontend/admin/dist", f))
ext := filepath.Ext(f)
mime := mime.TypeByExtension(ext)
log.Infof("mime type: %s %s", ext, mime)
ctx.Set(fiber.HeaderContentType, mime)
file, err := fabfile.Find(filepath.Join(svc.App.DistAdmin, f))
if err != nil {
return ctx.SendStatus(fiber.StatusNotFound)
}
@@ -131,9 +137,9 @@ func Serve(cmd *cobra.Command, args []string) error {
log.Infof("mime type: %s %s", ext, mime)
ctx.Set(fiber.HeaderContentType, mime)
file, err := fabfile.Find(filepath.Join("frontend/wechat/dist", f))
file, err := fabfile.Find(filepath.Join(svc.App.DistWeChat, f))
if err != nil {
file, err = fabfile.Find(filepath.Join("frontend/wechat/dist", "index.html"))
file, err = fabfile.Find(filepath.Join(svc.App.DistWeChat, "index.html"))
if err != nil {
return ctx.SendStatus(fiber.StatusNotFound)
}