feat:添加官方声明内容

- 在 VersionInfo 结构中增加 OfficialStatement 字段
- 在前端 App.vue 中添加官方声明内容的获取和显示
- 在 main.go 中定义 OFFICIAL_STATEMENT 变量
- 更新 GitHub Actions 构建配置,添加 OFFICIAL_STATEMENT环境变量
This commit is contained in:
ArvinLovegood 2025-07-01 09:47:46 +08:00
parent 3e16574faa
commit 2e5ec6ace8
6 changed files with 27 additions and 14 deletions

View File

@ -9,6 +9,7 @@ on:
env:
# Necessary for most environments as build failure can occur due to OOM issues
NODE_OPTIONS: "--max-old-space-size=4096"
OFFICIAL_STATEMENT: ${{ vars.OFFICIAL_STATEMENT }}
jobs:
build:
@ -38,7 +39,7 @@ jobs:
echo "::set-output name=commit_message::$commit_message"
- name: Build wails x go-stock
uses: ArvinLovegood/wails-build-action@v3.4
uses: ArvinLovegood/wails-build-action@v3.5
id: build
with:
build-name: ${{ matrix.build.name }}
@ -47,4 +48,5 @@ jobs:
go-version: '1.24'
build-tags: ${{ github.ref_name }}
build-commit-message: ${{ steps.get_commit_message.outputs.commit_message }}
build-statement: ${{ env.OFFICIAL_STATEMENT }}
node-version: '20.x'

11
app.go
View File

@ -764,11 +764,12 @@ func (a *App) GetAIResponseResult(stock string) *models.AIResponseResult {
func (a *App) GetVersionInfo() *models.VersionInfo {
return &models.VersionInfo{
Version: Version,
Icon: GetImageBase(icon),
Alipay: GetImageBase(alipay),
Wxpay: GetImageBase(wxpay),
Content: VersionCommit,
Version: Version,
Icon: GetImageBase(icon),
Alipay: GetImageBase(alipay),
Wxpay: GetImageBase(wxpay),
Content: VersionCommit,
OfficialStatement: OFFICIAL_STATEMENT,
}
}

View File

@ -150,13 +150,14 @@ func (receiver AIResponseResult) TableName() string {
type VersionInfo struct {
gorm.Model
Version string `json:"version"`
Content string `json:"content"`
Icon string `json:"icon"`
Alipay string `json:"alipay"`
Wxpay string `json:"wxpay"`
BuildTimeStamp int64 `json:"buildTimeStamp"`
IsDel soft_delete.DeletedAt `gorm:"softDelete:flag"`
Version string `json:"version"`
Content string `json:"content"`
Icon string `json:"icon"`
Alipay string `json:"alipay"`
Wxpay string `json:"wxpay"`
BuildTimeStamp int64 `json:"buildTimeStamp"`
OfficialStatement string `json:"officialStatement"`
IsDel soft_delete.DeletedAt `gorm:"softDelete:flag"`
}
func (receiver VersionInfo) TableName() string {

View File

@ -27,7 +27,7 @@ import {
StarOutline,
Wallet, WarningOutline,
} from '@vicons/ionicons5'
import {AnalyzeSentiment, GetConfig, GetGroupList} from "../wailsjs/go/main/App";
import {AnalyzeSentiment, GetConfig, GetGroupList,GetVersionInfo} from "../wailsjs/go/main/App";
import {Dragon, Fire, Gripfire} from "@vicons/fa";
import {ReportSearch} from "@vicons/tabler";
import {LocalFireDepartmentRound} from "@vicons/material";
@ -518,6 +518,12 @@ window.onerror = function (msg, source, lineno, colno, error) {
};
onBeforeMount(() => {
GetVersionInfo().then(result => {
if(result.officialStatement){
content.value = result.officialStatement
}
})
GetGroupList().then(result => {
groupList.value = result
menuOptions.value.map((item) => {

View File

@ -701,6 +701,7 @@ export namespace models {
alipay: string;
wxpay: string;
buildTimeStamp: number;
officialStatement: string;
IsDel: number;
static createFrom(source: any = {}) {
@ -719,6 +720,7 @@ export namespace models {
this.alipay = source["alipay"];
this.wxpay = source["wxpay"];
this.buildTimeStamp = source["buildTimeStamp"];
this.officialStatement = source["officialStatement"];
this.IsDel = source["IsDel"];
}

View File

@ -53,6 +53,7 @@ var stocksBinUS []byte
var Version string
var VersionCommit string
var OFFICIAL_STATEMENT string
func main() {
checkDir("data")