Python icon indicating copy to clipboard operation
Python copied to clipboard

wechat 项目获取token函数有误

Open for1gumer opened this issue 5 years ago • 1 comments

def get_access_token(appid, secret): '''获取access_token,100分钟刷新一次'''

url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={}&secret={}'.format(appid, secret)
r = requests.get(url)
parse_json = json.loads(r.text)
global token
token = parse_json['access_token']
global timer
timer = threading.Timer(6000, get_access_token) //这地方没有传参数。
timer.start()

for1gumer avatar Nov 06 '19 03:11 for1gumer

感谢老铁的项目学习了

for1gumer avatar Nov 06 '19 03:11 for1gumer