改为一般环境能启动
This commit is contained in:
parent
5383e2fa60
commit
404ff9c300
|
@ -3,9 +3,9 @@
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve ",
|
||||||
"build": "vue-cli-service build",
|
"build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build ",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint "
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
|
|
|
@ -47,7 +47,7 @@ func initMovie() {
|
||||||
width := 160
|
width := 160
|
||||||
height := 120
|
height := 120
|
||||||
log.Println(filename)
|
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
|
var buffer bytes.Buffer
|
||||||
cmd.Stdout = &buffer
|
cmd.Stdout = &buffer
|
||||||
if cmd.Run() != nil {
|
if cmd.Run() != nil {
|
||||||
|
@ -56,12 +56,12 @@ func initMovie() {
|
||||||
}
|
}
|
||||||
|
|
||||||
filepath.Walk("./movie", func(path string, info fs.FileInfo, err error) error {
|
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()
|
base := info.Name()
|
||||||
log.Println(path, info.Name())
|
log.Println(path, info.Name())
|
||||||
movies = append(movies, Movie{
|
movies = append(movies, Movie{
|
||||||
Name: info.Name(),
|
Name: info.Name(),
|
||||||
Image: base[:strings.IndexByte(base, '.')] + ".webp",
|
Image: base[:strings.IndexByte(base, '.')] + ".png",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
7
server/main_test.go
Normal file
7
server/main_test.go
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
func TestMain(t *testing.T) {
|
||||||
|
main()
|
||||||
|
}
|
|
@ -4,9 +4,9 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
var Host = "http://localhost:4444"
|
var Host = "http://192.168.31.121:4444"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default ({
|
export default ({
|
||||||
Host: Host,
|
Host: Host,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user