fix(wish-tree): 图片扩展名改为 .jpg
Publish Mini Program Dev Version / publish (push) Failing after 1m38s
Build and Deploy Server / build (push) Failing after 3s

- 实际格式是 JPEG,扩展名从 .png 改为 .jpg
- 大小 332KB,远低于微信 2M 限制
This commit is contained in:
gouki
2026-08-08 17:14:30 +00:00
parent 531d342eb6
commit daebda22ee
9 changed files with 118 additions and 5 deletions
+3
View File
@@ -42,6 +42,9 @@ func main() {
// API 路由
api := r.Group("/api")
{
// 版本信息(无需认证)
api.GET("/version", handler.GetVersion)
// 用户相关
user := api.Group("/user")
{
+42
View File
@@ -0,0 +1,42 @@
package handler
import (
"net/http"
"os"
"github.com/gin-gonic/gin"
)
// VersionInfo 版本信息
type VersionInfo struct {
Version string `json:"version"`
BuildTime string `json:"buildTime"`
CommitSha string `json:"commitSha"`
GoVersion string `json:"goVersion"`
}
// GetVersion 获取服务器版本信息
func GetVersion(c *gin.Context) {
// 从环境变量读取版本信息(由 CI 构建时注入)
version := os.Getenv("APP_VERSION")
if version == "" {
version = "dev"
}
buildTime := os.Getenv("APP_BUILD_TIME")
if buildTime == "" {
buildTime = "unknown"
}
commitSha := os.Getenv("APP_COMMIT_SHA")
if commitSha == "" {
commitSha = "unknown"
}
c.JSON(http.StatusOK, VersionInfo{
Version: version,
BuildTime: buildTime,
CommitSha: commitSha,
GoVersion: "go1.22", // 可以通过 runtime.Version() 获取
})
}