Exemple #1
0
        public IHttpActionResult Logout()
        {
            try
            {
                //不是单点登录,正常退出,否则返回登录地址
                if (!ConfigHelper.GetConfigBool("IsSso"))
                {
                    var request   = new AuthenticatedRequest();
                    var adminInfo = request.IsAdminLoggin ? request.AdminInfo : null;
                    request.AdminLogout();

                    return(Ok(new
                    {
                        Value = adminInfo
                    }));
                }

                return(Ok(new
                {
                    Sso = true,
                    Value = ConfigHelper.GetConfigString("SSOUrl")
                }));
            }
            catch (Exception ex)
            {
                LogUtils.AddErrorLog(ex);
                return(InternalServerError(ex));
            }
        }
        public IHttpActionResult Logout()
        {
            try
            {
                var request   = new AuthenticatedRequest();
                var adminInfo = request.IsAdminLoggin ? request.AdminInfo : null;
                request.AdminLogout();

                return(Ok(new
                {
                    Value = adminInfo
                }));
            }
            catch (Exception ex)
            {
                LogUtils.AddErrorLog(ex);
                return(InternalServerError(ex));
            }
        }