增加保存管理员语言选择的API

This commit is contained in:
刘祥超
2023-12-12 22:40:06 +08:00
parent c5fb340eb7
commit 44d45c53a1
2 changed files with 23 additions and 0 deletions

View File

@@ -313,6 +313,14 @@ func (this *AdminDAO) UpdateAdminTheme(tx *dbs.Tx, adminId int64, theme string)
UpdateQuickly()
}
// UpdateAdminLang 设置管理员语言
func (this *AdminDAO) UpdateAdminLang(tx *dbs.Tx, adminId int64, langCode string) error {
return this.Query(tx).
Pk(adminId).
Set("lang", langCode).
UpdateQuickly()
}
// CheckSuperAdmin 检查管理员是否为超级管理员
func (this *AdminDAO) CheckSuperAdmin(tx *dbs.Tx, adminId int64) (bool, error) {
if adminId <= 0 {