feat(version): move AnswerVersion to site-info API

This commit is contained in:
LinkinStars 2023-02-15 17:22:44 +08:00
parent edc06942d5
commit e9d5667708
3 changed files with 3 additions and 2 deletions

View File

@ -41,6 +41,6 @@ install-ui-packages:
@corepack prepare pnpm@v7.12.2 --activate
ui:
@cd ui && pnpm install && pnpm build && sed -i 's/%AnswerVersion%/'$(VERSION)'/g' ./build/index.html && cd -
@cd ui && pnpm install && pnpm build && cd -
all: clean build

View File

@ -31,7 +31,7 @@ func NewSiteinfoController(siteInfoService *siteinfo_common.SiteInfoCommonServic
// @Router /answer/api/v1/siteinfo [get]
func (sc *SiteinfoController) GetSiteInfo(ctx *gin.Context) {
var err error
resp := &schema.SiteInfoResp{}
resp := &schema.SiteInfoResp{Version: constant.Version}
resp.General, err = sc.siteInfoService.GetSiteGeneral(ctx)
if err != nil {
log.Error(err)

View File

@ -166,6 +166,7 @@ type SiteInfoResp struct {
Theme *SiteThemeResp `json:"theme"`
CustomCssHtml *SiteCustomCssHTMLResp `json:"custom_css_html"`
SiteSeo *SiteSeoReq `json:"site_seo"`
Version string `json:"version"`
}
type TemplateSiteInfoResp struct {
General *SiteGeneralResp `json:"general"`