Ejemplo n.º 1
0
        private static async void LoginZhiHu(LoginType loginType, Action <bool, object> loginCallback)
        {
            var zhiHuAuthoData = await DataRequester.Login(Authorizations[loginType].LoginData);

            if (zhiHuAuthoData == null)
            {
                loginCallback(false, StringUtil.GetString("LoginZhiHuFailed"));
                return;
            }
            StorageUtil.StorageInfo.LoginType      = loginType;
            StorageUtil.StorageInfo.ZhiHuAuthoInfo = zhiHuAuthoData;
            StorageUtil.UpdateStorageInfo();

            IsLogin = true;
            SetHttpAuthorization();
            loginCallback(true, StringUtil.GetString("LoginSuccess"));
        }