Ejemplo n.º 1
0
        private void InitToken(Exception exception = null)
        {
            var    tokenSign = _tokenUtil.GetTokenSign();
            string tokenKey;

            try
            {
                tokenKey =
                    (string)Serializer.Deserialize(_service.GetToken(Serializer.Serialize(tokenSign.Signature),
                                                                     Serializer.Serialize(tokenSign.Timestamp), Serializer.Serialize(tokenSign.Nonce)));
            }
            catch (Exception ex)
            {
                throw new QfException("无法获取令牌公钥,可能是服务端已更新造成的连接问题,请重启客户端稍后登录!", ex);
            }
            if (!_tokenUtil.InitToken(tokenKey))
            {
                throw new QfException("无法初始化连接令牌,可能是服务端已更新造成的连接问题,请重启客户端稍后登录!", exception);
            }
            UpdateClientInfo();
        }