From 09f754f2acc81c6a2d9989f9c0e89b0ebaf72a3a Mon Sep 17 00:00:00 2001 From: v7lin Date: Tue, 26 Mar 2019 16:23:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/lib/main.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/example/lib/main.dart b/example/lib/main.dart index ff1d02e..82feb2e 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -54,7 +54,6 @@ class _HomeState extends State { StreamSubscription _share; TencentLoginResp _loginResp; - DateTime _loginDate; @override void initState() { @@ -65,7 +64,6 @@ class _HomeState extends State { } void _listenLogin(TencentLoginResp resp) { - _loginDate = DateTime.now(); _loginResp = resp; String content = 'login: ${resp.openid} - ${resp.accessToken}'; _showTips('登录', content); @@ -122,8 +120,7 @@ class _HomeState extends State { ListTile( title: const Text('获取用户信息'), onTap: () { - if (_loginDate != null && - _loginResp != null && + if (_loginResp != null && _loginResp.ret == TencentResp.RET_SUCCESS) { if (DateTime.now().millisecondsSinceEpoch - _loginResp.createAt <