Beispiel #1
0
    def _done(self):
        res = self.helper.get_username()
        if not res.success:
            self._fail('获取 CSDN 用户名')
            print('获取 CSDN 用户名失败: ' + self.act['uid'])
            return
        csdn = res.result

        res2 = self.helper.get_user_info()
        if not res2.success:
            self._fail('获取 CSDN 用户信息失败')
            print('获取 CSDN 用户信息失败: ' + self.act['uid'])
            return
        info = res2.result

        self._over(False)
        file_helper.move_option(self.helper.option_name, csdn)
        print('登录完成: ' + csdn)
        self.set_state('done', info)
        db.user_set_state(self.act['uid'], csdn, 'on')
        db.user_set_info(self.act['uid'], csdn, info)
Beispiel #2
0
 def _done(self):
     print(f'账户状态(有效): {self.csdn}')
     self._over()
     self.set_state('done', 'on')
     db.user_set_state(self.act['uid'], self.csdn, 'on')
Beispiel #3
0
 def _expired(self):
     print(f'账户状态(过期): {self.csdn}')
     self._over()
     self.set_state('done', 'expired')
     db.user_set_state(self.act['uid'], self.csdn, 'expired')
 def expired(self):
     print(f'验证登陆状态(失效): {self.csdn}')
     self._over()
     self.set_state('done', 'expired')
     db.user_set_state(self.act['uid'], self.csdn, 'expired')