feat: update build issues
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user