Browse Source

更新

master
dongchangxi 2 years ago
parent
commit
9a6d9f6f37
  1. 7
      .gitignore
  2. BIN
      build/appicon.png
  3. BIN
      build/windows/icon.ico
  4. 5
      build/windows/installer/project.nsi
  5. 6
      build/windows/installer/wails_tools.nsh
  6. 2
      frontend/package.json.md5
  7. 1
      frontend/src/components/ShopUrl.vue
  8. 4
      go.mod
  9. 2
      go.sum
  10. 2
      initFunc/startPiVideo.go
  11. 12
      main.go
  12. 38
      wails.json

7
.gitignore vendored

@ -1,3 +1,10 @@
build/bin build/bin
node_modules node_modules
frontend/dist frontend/dist
build/windows/installer
piVideo/web/static
static
piVideo
initFunc/piserver_root.crt
frontend/src/assets
build/darwin/Info.dev.plist

BIN
build/appicon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 134 KiB

BIN
build/windows/icon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

5
build/windows/installer/project.nsi

@ -89,7 +89,7 @@ Section
!insertmacro wails.files !insertmacro wails.files
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" "" ".\icon.ico" CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" "" "$INSTDIR\icon.ico"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer" "Shell Icons" "" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer" "Shell Icons" ""
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer" "Shell Icons" DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer" "Shell Icons"
@ -101,6 +101,7 @@ Section
!insertmacro wails.writeUninstaller !insertmacro wails.writeUninstaller
File ".\piserver_root.crt" File ".\piserver_root.crt"
File "..\icon.ico"
SetOutPath "$INSTDIR\piVideo" SetOutPath "$INSTDIR\piVideo"
File /r ".\piVideo\*" File /r ".\piVideo\*"
@ -108,7 +109,7 @@ SectionEnd
Section "uninstall" Section "uninstall"
!insertmacro wails.setShellContext !insertmacro wails.setShellContext
ExecWait '"taskkill" /F /IM "piVideo.exe"'
RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
RMDir /r $INSTDIR RMDir /r $INSTDIR

6
build/windows/installer/wails_tools.nsh

@ -5,13 +5,13 @@
!include "FileFunc.nsh" !include "FileFunc.nsh"
!ifndef INFO_PROJECTNAME !ifndef INFO_PROJECTNAME
!define INFO_PROJECTNAME "狒功夫3D拍照系统" !define INFO_PROJECTNAME "速哇3D摄影管理平台"
!endif !endif
!ifndef INFO_COMPANYNAME !ifndef INFO_COMPANYNAME
!define INFO_COMPANYNAME "狒功夫3D拍照系统" !define INFO_COMPANYNAME "速哇3D摄影管理平台"
!endif !endif
!ifndef INFO_PRODUCTNAME !ifndef INFO_PRODUCTNAME
!define INFO_PRODUCTNAME "狒功夫3D拍照系统" !define INFO_PRODUCTNAME "速哇3D摄影管理平台"
!endif !endif
!ifndef INFO_PRODUCTVERSION !ifndef INFO_PRODUCTVERSION
!define INFO_PRODUCTVERSION "1.0.0" !define INFO_PRODUCTVERSION "1.0.0"

2
frontend/package.json.md5

@ -1 +1 @@
21d2a2199c4fb87865d8160b492f51c3 d2d8b7df75ca4fc09071d6242268e519

1
frontend/src/components/ShopUrl.vue

@ -11,6 +11,7 @@ import {ShopUrl} from '../../wailsjs/go/main/App'
// //
function openWebUrl() { function openWebUrl() {
localStorage.setItem("oem_exe",1)
ShopUrl().then(result => { ShopUrl().then(result => {
window.location.href = result window.location.href = result
}) })

4
go.mod

@ -1,6 +1,8 @@
module changeme module changeme
go 1.18 go 1.21
toolchain go1.21.6
require ( require (
github.com/gogf/gf v1.16.9 github.com/gogf/gf v1.16.9

2
go.sum

@ -35,6 +35,7 @@ github.com/gomodule/redigo v1.8.5 h1:nRAxCa+SVsyjSBrtZmG/cqb6VbTmuRzpg/PoTFlpumc
github.com/gomodule/redigo v1.8.5/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0= github.com/gomodule/redigo v1.8.5/go.mod h1:P9dn9mFrCBvWhGE1wpxx6fgq7BAeLBk+UUUzlpkBYO0=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
@ -92,6 +93,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE= github.com/tkrajina/go-reflector v0.5.6 h1:hKQ0gyocG7vgMD2M3dRlYN6WBBOmdoOzJ6njQSepKdE=
github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4= github.com/tkrajina/go-reflector v0.5.6/go.mod h1:ECbqLgccecY5kPmPmXg1MrHW585yMcDkVl6IvJe64T4=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=

2
initFunc/startPiVideo.go

@ -5,6 +5,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"time" "time"
"syscall"
) )
// 执行exe 文件,开启视频监控的服务进程 // 执行exe 文件,开启视频监控的服务进程
@ -34,6 +35,7 @@ func killPiServerExe() {
exeName := "piVideo.exe" exeName := "piVideo.exe"
// 使用exec.Command函数创建一个Cmd结构体,用于执行命令 // 使用exec.Command函数创建一个Cmd结构体,用于执行命令
cmd := exec.Command("taskkill", "/f", "/im", exeName) cmd := exec.Command("taskkill", "/f", "/im", exeName)
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow:true}
// 将命令的输出和错误连接到当前进程的标准输出和标准错误 // 将命令的输出和错误连接到当前进程的标准输出和标准错误
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr

12
main.go

@ -9,8 +9,11 @@ import (
"github.com/gogf/gf/util/gconv" "github.com/gogf/gf/util/gconv"
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"
"github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/menu"
"github.com/wailsapp/wails/v2/pkg/menu/keys"
"github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver" "github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/runtime"
) )
//go:embed all:frontend/dist //go:embed all:frontend/dist
@ -45,6 +48,14 @@ func main() {
} }
} }
//增加菜单
AppMenu := menu.NewMenu()
SubMenu := AppMenu.AddSubmenu("工具")
SubMenu.AddText("刷新", keys.CmdOrCtrl("F5"), func(_ *menu.CallbackData) {
runtime.Reload(app.ctx)
})
// Create application with options // Create application with options
err := wails.Run(&options.App{ err := wails.Run(&options.App{
Title: wailsConfigOem["brand_name"].(string), Title: wailsConfigOem["brand_name"].(string),
@ -55,6 +66,7 @@ func main() {
}, },
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1}, BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: app.startup, OnStartup: app.startup,
Menu: AppMenu,
Bind: []interface{}{ Bind: []interface{}{
app, app,
}, },

38
wails.json

@ -1,7 +1,7 @@
{ {
"$schema": "https://wails.io/schemas/config.v2.json", "$schema": "https://wails.io/schemas/config.v2.json",
"name": "狒功夫3D拍照系统", "name": "速哇3D摄影管理平台",
"outputfilename": "狒功夫3D拍照系统", "outputfilename": "12",
"frontend:install": "npm install", "frontend:install": "npm install",
"frontend:build": "npm run build", "frontend:build": "npm run build",
"frontend:dev:watcher": "npm run dev", "frontend:dev:watcher": "npm run dev",
@ -18,30 +18,34 @@
], ],
"outputDir": ".", "outputDir": ".",
"pack": { "pack": {
"include": ["./wails.json"] "include": [
"./wails.json"
]
}, },
"ext_oem": { "ext_oem": {
"id": 1, "id": 12,
"domain": "http://127.0.0.1:9222/", "domain": "shop.suwa3d.com",
"logo": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0g0soo757400ao378x.png", "logo": "https://www.suwa3d.com/oem/2023/09/27/1ymv3fc24lpcvtmyos8cag8900x7md5f.png",
"short_logo": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0g2n2jxf25006e503t.png", "short_logo": "https://www.suwa3d.com/oem/2023/09/27/1ymv3fc24lpcvtmykbsrr1e8008y4z27.png",
"favicon": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0h1qiuqc7700vodjg8.png", "favicon": "https://www.suwa3d.com/oem/2024/03/05/1292gxb4g1qczlppvu48hcl7001nl3nt.ico",
"brand_name": "狒功夫3D拍照系统", "brand_name": "速哇3D摄影管理平台",
"link": "13779966891", "link": "1",
"photo_title": "狒功夫3D拍照系统", "photo_title": "速哇3D摄影管理平台",
"link_shop_id": "0", "link_shop_id": "0",
"api_host": "https://shop.api.suwa3d.com/admin", "api_host": "https://shop.api.suwa3d.com/admin",
"createTime": "2024-01-22 14:12:26", "createTime": "2023-04-18 11:08:00",
"updateTime": "2024-01-22 14:12:26", "updateTime": "2024-03-06 10:16:44",
"type": 1, "type": 1,
"wechat_login": 1, "wechat_login": 1,
"wechat_login_url": "https://wechat.api.suwa3d.com/wxAuthor.html?wxparams=", "wechat_login_url": "https://wechat.api.suwa3d.com/wxAuthor.html?wxparams=",
"language": "zh-CN", "language": "zh-CN",
"default_page": "/takephoto", "default_page": "/takephoto",
"data_url": "https://3dview.suwa3d.com", "data_url": "https://3dview.suwa3d.com",
"website_url": "https://www.sugongfu.com", "website_url": "https://www.suwa3d.com",
"print_logo": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0g4p4fttm600u87znx.png", "print_logo": "https://www.suwa3d.com/oem/2024/03/05/1292gxb4dd5czlosocroa5s1a0u0va2v.png",
"show_print_tip": "", "show_print_tip": "关注速哇3D摄影微信公众号,可查询订单进度信息。",
"webwechat": "https://wechat.suwa3d.com" "webwechat": "https://wechat.suwa3d.com",
"set_up_status": 0,
"exe_logo": "https://www.suwa3d.com/oem/2024/03/05/1292gxb4g1qczlpiadsaguu200l0y6d2.png"
} }
} }
Loading…
Cancel
Save