def refresh_signin_vcode(cookie, tokens, vcodetype):
 url = ''.join([const.PASSPORT_BASE, 'v2/?reggetcodestr', '&token=', tokens['token'], '&tpl=pp&apiver=v3', '&tt=', util.timestamp(), '&fr=ligin', '&vcodetype=', encoder.encode_uri(vcodetype)])
 headers = {'Cookie': cookie.header_output(), 'Referer': const.REFERER}
 logger.debug(('refresh vcode url: %s' % url))
 req = net.urlopen(url, headers=headers)
 if req:
  try:
   data = req.data.decode('gbk')
   logger.debug(('refresh vcode: %s' % data))
   return json.loads(data)
  except ValueError:
   logger.error(traceback.format_exc())
 return None

def refresh_signin_vcode ( cookie , tokens , vcodetype ) : url = '' . join ( [ const . PASSPORT_BASE , 'v2/?reggetcodestr' , '&token=' , tokens [ 'token' ] , '&tpl=pp&apiver=v3' , '&tt=' , util . timestamp ( ) , '&fr=ligin' , '&vcodetype=' , encoder . encode_uri ( vcodetype ) ] ) headers = { 'Cookie' : cookie . header_output ( ) , 'Referer' : const . REFERER } logger . debug ( ( 'refresh vcode url: %s' % url ) ) req = net . urlopen ( url , headers = headers ) if req : try : data = req . data . decode ( 'gbk' ) logger . debug ( ( 'refresh vcode: %s' % data ) ) return json . loads ( data ) except ValueError : logger . error ( traceback . format_exc ( ) ) return None
vcodetype - 在调用check_login()时返回的vcodetype .