// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn . package identity import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/userconfigs" "github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils" "github.com/iwind/TeaGo/maps" ) type EnterpriseAction struct { actionutils.ParentAction } func (this *EnterpriseAction) Init() { this.Nav("", "", "") } func (this *EnterpriseAction) RunGet(params struct{}) { resp, err := this.RPC().UserIdentityRPC().FindEnabledUserIdentityWithOrgType(this.UserContext(), &pb.FindEnabledUserIdentityWithOrgTypeRequest{ OrgType: userconfigs.UserIdentityOrgTypeEnterprise, }) if err != nil { this.ErrorPage(err) return } var userIdentity = resp.UserIdentity if userIdentity == nil { this.Data["identity"] = nil this.Show() return } if len(userIdentity.FileIds) != 1 { this.Data["identity"] = nil this.Show() return } this.Data["identity"] = maps.Map{ "id": userIdentity.Id, "realName": userIdentity.RealName, "number": userIdentity.Number, "status": userIdentity.Status, "frontFileId": userIdentity.FileIds[0], "rejectReason": userIdentity.RejectReason, } this.Show() }