将 license 存储到数据库

This commit is contained in:
RockYang
2025-03-02 21:49:34 +08:00
parent ed063a1d9d
commit 0ef51714c9
5 changed files with 34 additions and 7 deletions

View File

@@ -131,8 +131,17 @@ func (h *ConfigHandler) Active(c *gin.Context) {
resp.ERROR(c, err.Error())
return
}
h.App.SysConfig.License = data.License
// 将 license 写入数据库
err = h.DB.Model(&model.Config{}).Where("marker", "system").UpdateColumn("config_json", utils.JsonEncode(h.App.SysConfig)).Error
if err != nil {
resp.ERROR(c, err.Error())
return
}
resp.SUCCESS(c)
resp.SUCCESS(c, info.HostID)
}
// GetLicense 获取 License 信息