feat: update issues
This commit is contained in:
@@ -2,6 +2,7 @@ package http
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"mime"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
appHttp "quyun/app/http"
|
appHttp "quyun/app/http"
|
||||||
@@ -125,11 +126,18 @@ func Serve(cmd *cobra.Command, args []string) error {
|
|||||||
if f == "/" || f == "" {
|
if f == "/" || f == "" {
|
||||||
f = "index.html"
|
f = "index.html"
|
||||||
}
|
}
|
||||||
|
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("frontend/wechat/dist", f))
|
file, err := fabfile.Find(filepath.Join("frontend/wechat/dist", f))
|
||||||
|
if err != nil {
|
||||||
|
file, err = fabfile.Find(filepath.Join("frontend/wechat/dist", "index.html"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ctx.SendStatus(fiber.StatusNotFound)
|
return ctx.SendStatus(fiber.StatusNotFound)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ctx.SendFile(file)
|
return ctx.SendFile(file)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { createPinia } from 'pinia';
|
|||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
import App from './App.vue';
|
import App from './App.vue';
|
||||||
import { router } from './router.js';
|
import { router } from './router.js';
|
||||||
import './style.css';
|
import './styles.css';
|
||||||
|
|
||||||
|
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|||||||
@@ -4,16 +4,6 @@ import { resolve } from 'path';
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
chunkFileNames: 'static/assets/js/[name]-[hash].js',
|
|
||||||
entryFileNames: 'static/assets/js/[name]-[hash].js',
|
|
||||||
assetFileNames: 'static/assets/[ext]/[name]-[hash].[ext]',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
base: "./",
|
|
||||||
minify: true,
|
minify: true,
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|||||||
Reference in New Issue
Block a user