feat: update mime log

This commit is contained in:
yanghao05
2025-04-28 21:02:47 +08:00
parent 64e01b0bb2
commit 93fabb035f

View File

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