管理界面可以切换风格

This commit is contained in:
刘祥超
2021-07-12 10:21:28 +08:00
parent 21c51cbdc8
commit 877d42a271
3 changed files with 44 additions and 19 deletions

View File

@@ -298,6 +298,7 @@ func (this *AdminService) FindAllAdminModules(ctx context.Context, req *pb.FindA
AdminId: int64(admin.Id),
IsSuper: admin.IsSuper == 1,
Fullname: admin.Fullname,
Theme: admin.Theme,
Modules: pbModules,
}
result = append(result, list)
@@ -633,3 +634,17 @@ func (this *AdminService) ComposeAdminDashboard(ctx context.Context, req *pb.Com
return resp, nil
}
// UpdateAdminTheme 修改管理员使用的界面风格
func (this *AdminService) UpdateAdminTheme(ctx context.Context, req *pb.UpdateAdminThemeRequest) (*pb.RPCSuccess, error) {
_, err := this.ValidateAdmin(ctx, req.AdminId)
if err != nil {
return nil, err
}
var tx = this.NullTx()
err = models.SharedAdminDAO.UpdateAdminTheme(tx, req.AdminId, req.Theme)
if err != nil {
return nil, err
}
return this.Success()
}