From 404ff9c3000673d798eb64ff947509e4d08b12a6 Mon Sep 17 00:00:00 2001 From: eson <474420502@qq.com> Date: Wed, 10 May 2023 12:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=B8=80=E8=88=AC=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E8=83=BD=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- server/main.go | 6 +++--- server/main_test.go | 7 +++++++ src/Config.vue | 4 ++-- 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 server/main_test.go diff --git a/package.json b/package.json index c7d265e..a5bf81b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/server/main.go b/server/main.go index 9a984b5..1416ad7 100644 --- a/server/main.go +++ b/server/main.go @@ -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 diff --git a/server/main_test.go b/server/main_test.go new file mode 100644 index 0000000..ef64976 --- /dev/null +++ b/server/main_test.go @@ -0,0 +1,7 @@ +package main + +import "testing" + +func TestMain(t *testing.T) { + main() +} diff --git a/src/Config.vue b/src/Config.vue index 275d4ad..b54ca6a 100644 --- a/src/Config.vue +++ b/src/Config.vue @@ -4,9 +4,9 @@