checkSession method

Future<bool> checkSession()

检查用户的登录是否过期

Implementation

Future<bool> checkSession() async {
  if (objectId.isEmpty || sessionToken.isEmpty) {
    throw Exception('objectId or sessionToken is empty');
  }
  var data = await BmobNetHelper.init().get('/1/checkSession/$objectId');
  return data != null && data.containsKey('msg') && data['msg'] == 'ok';
}