公会弹劾修复

This commit is contained in:
wh_zcy 2022-11-03 15:01:15 +08:00
parent 6d6e99606d
commit 090422083a
4 changed files with 27 additions and 9 deletions

View File

@ -310,5 +310,11 @@
"open": true,
"routrules": "~/worker",
"describe": "公会日志列表"
},
{
"msgid": "sociaty.accuse",
"open": true,
"routrules": "~/worker",
"describe": "弹劾"
}
]

View File

@ -430,10 +430,22 @@ func (this *SociatyMineView) showSociatyMemberWin() {
})
//弹劾
tanheBtn := widget.NewButton("弹劾", nil)
tanheBtn := widget.NewButton("弹劾", func() {
dialog.ShowConfirm("提示", "确定弹劾会长?", func(b bool) {
if !b {
return
}
if err := service.GetPttService().SendToClient(
string(comm.ModuleSociaty),
sociaty.SociatySubTypeAccuse,
&pb.SociatyAccuseReq{},
); err != nil {
logrus.Error(err)
return
}
// 退出
quitBtn := widget.NewButton("退出", nil)
}, this.w)
})
// 转让
zhuanrangBtn := widget.NewButton("转让", func() {
@ -526,11 +538,10 @@ func (this *SociatyMineView) showSociatyMemberWin() {
this.job == pb.SociatyJob_ADMIN {
btns.Add(tirenBtn)
btns.Add(tanheBtn)
btns.Add(quitBtn)
}
// 成员
if this.job == pb.SociatyJob_MEMBER {
btns.Add(quitBtn)
btns.Add(tanheBtn)
}
c := container.NewBorder(btns, nil, nil, nil, this.memberList.ItemList)

View File

@ -17,6 +17,7 @@ const (
SociatySubTypeCancel = "cancel"
SociatySubTypeDismiss = "dismiss"
SociatySubTypeQuit = "quit"
SociatySubTypeAccuse = "accuse"
SociatySubTypeAgree = "agree"
SociatySubTypeRefuse = "refuse"
SociatySubTypeSetting = "setting"

View File

@ -9,12 +9,12 @@ import (
// 弹劾会长
func (this *apiComp) AsscuseCheck(session comm.IUserSession, req *pb.SociatyAccuseReq) (code pb.ErrorCode) {
func (this *apiComp) AccuseCheck(session comm.IUserSession, req *pb.SociatyAccuseReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Asscuse(session comm.IUserSession, req *pb.SociatyAccuseReq) (code pb.ErrorCode, data proto.Message) {
if code = this.AsscuseCheck(session, req); code != pb.ErrorCode_Success {
func (this *apiComp) Accuse(session comm.IUserSession, req *pb.SociatyAccuseReq) (code pb.ErrorCode, data proto.Message) {
if code = this.AccuseCheck(session, req); code != pb.ErrorCode_Success {
return
}
uid := session.GetUserId()
@ -43,7 +43,7 @@ func (this *apiComp) Asscuse(session comm.IUserSession, req *pb.SociatyAccuseReq
SociatyId: sociaty.Id,
}
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeAgree, rsp); err != nil {
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeAccuse, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return