Foxtable(狐表)用户栏目专家坐堂 → UserLogging事件已经success,但是还是没登录成功~


  共有3034人关注过本帖平板打印复制链接

主题:UserLogging事件已经success,但是还是没登录成功~

帅哥哟,离线,有人找我吗?
huangxueyao
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:443 积分:3530 威望:0 精华:0 注册:2013/2/9 12:45:00
UserLogging事件已经success,但是还是没登录成功~  发帖心情 Post By:2018/9/15 11:49:00 [只看该作者]

Try
    
    Dim cmd As New SQLCommand
    cmd.ConnectionName= gs_strActiveConnLog
    cmd.CommandText="Sel ect a.工号,a.账号,a.部门ID,a.用户名称,b.部门名称 from 用户名表 a left join 公司部门表 b on a.部门ID=b.部门编号"
    Dim dt As DataTable=cmd.ExecuteReader
    Dim st As String = e.UserName.Split(".")(0) & "." & e.UserName.Split(".")(1)
    Dim dr1 As DataRow= dt.Find("部门名称='" & e.UserName.Split(".")(0) & "' and 用户名称='" & e.UserName.Split(".")(1) & "'")
    If dr1 IsNot Nothing Then
        PopMessage(e.UserName & "正在尝试登陆,已查询到用户信息!","提示", PopIconEnum.Infomation, 5)
        e.Success = True '允许用户登
        If dt.DataRows.Count>0 Then
            '添加所有同事为好友
            For Each dr As DataRow In dt.DataRows
                'If (dr("部门名称") & "." & dr("用户名称")) <> e.UserName Then '如果不是登录者本人
                If (dr("部门名称") & "." & dr("用户名称")) <> st Then '如果不是登录者本人
                    If e.Buddies.Contains(dr("部门名称") & "." & dr("用户名称") & "." & dr("账号"))=False Then
                        e.Buddies.Add(dr("部门名称") & "." & dr("用户名称") & "." & dr("账号"))
                    End If
                End If
            Next
        End If
    Else
        PopMessage(e.UserName & "正在尝试登陆,但未能在数据库查询到相关数据,登录失败!","提示", PopIconEnum.Infomation, 5)
        e.Success = False '拒绝用户登录
        e.Message= Functions.Execute("Xml发送信息","用户不存在!请重新确认用户名称!")
    End If
Catch ex As Exception
    e.Success = False
    e.Message=Functions.Execute("Xml发送信息","服务器端错误:" & ex.Message)
End Try

症状如下:
1、代码已经执行到红色部分,也就是e.Success = True,但是UserLoged事件还是不会触发。这个是怎么回事?
2、我的UserName是由部门名称+用户名称+用户ID构成,在别的项目已经测试成功没问题的,而且当前也正常运行的。

 回到顶部
总数 18 1 2 下一页