改为一般环境能启动

This commit is contained in:
eson 2023-05-10 12:46:06 +08:00
parent 5383e2fa60
commit 404ff9c300
4 changed files with 15 additions and 8 deletions

View File

@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve ",
"build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build ",
"lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint "
},
"dependencies": {
"axios": "^0.21.1",

View File

@ -47,7 +47,7 @@ func initMovie() {
width := 160
height := 120
log.Println(filename)
cmd := exec.Command("ffmpeg", "-i", filename, "-vframes", "1", "-s", fmt.Sprintf("%dx%d", width, height), "movie/"+key+".webp")
cmd := exec.Command("ffmpeg", "-i", filename, "-vframes", "1", "-s", fmt.Sprintf("%dx%d", width, height), "movie/"+key+".png")
var buffer bytes.Buffer
cmd.Stdout = &buffer
if cmd.Run() != nil {
@ -56,12 +56,12 @@ func initMovie() {
}
filepath.Walk("./movie", func(path string, info fs.FileInfo, err error) error {
if !info.IsDir() && filepath.Ext(info.Name()) != ".webp" {
if !info.IsDir() && filepath.Ext(info.Name()) != ".png" {
base := info.Name()
log.Println(path, info.Name())
movies = append(movies, Movie{
Name: info.Name(),
Image: base[:strings.IndexByte(base, '.')] + ".webp",
Image: base[:strings.IndexByte(base, '.')] + ".png",
})
}
return nil

7
server/main_test.go Normal file
View File

@ -0,0 +1,7 @@
package main
import "testing"
func TestMain(t *testing.T) {
main()
}

View File

@ -4,7 +4,7 @@
<script>
var Host = "http://localhost:4444"
var Host = "http://192.168.31.121:4444"
export default ({