成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術文章
文章詳情頁

python - 已關注粉絲再次掃描微信帶參數(shù)二維碼報錯

瀏覽:147日期:2022-09-12 14:38:51

問題描述

已關注粉絲再次掃描微信帶參數(shù)二維碼報錯。未關注粉絲掃描二維碼時,正常。第二次掃描時,提示“無法服務”

查后臺nginx日志 兩種場景均返回的為空,CODE 為200

@app.route('/',methods=['POST','GET','PUT'])def index(): if(request.method=='GET'): #驗證微信signature=request.args.get(’signature’, None)timestamp=request.args.get(’timestamp’,None)nonce=request.args.get(’nonce’,None)echostr=request.args.get(’echostr’,'hello')# logging.info(echostr)return echostr if(request.method=='POST'):soup=BeautifulSoup(request.data,'xml')logging.info('POST請求n'+str(soup))MsgType=soup.MsgType.stringif(MsgType==’event’): if(soup.Event.string=='SCAN' or soup.Event.string=='subscribe' ):key=soup.EventKey.stringopenid=soup.FromUserName.stringlogging.info('EventKey'+str(key))# 商店管理員掃描if(key.startswith('ownerid')): key=key.split('ownerid')[1] data={'openid':str(openid)} res=requests.put('http://www.example.com/owner/'+key+'/',json=data) return ’’# 商店顧客掃描if(key.startswith('qrscene_')): key=key.split('qrscene_')[1]data={'shopid':key}res=requests.put('http://www.example.com/customer/'+openid+'/',json=data)logging.info(str(res.json()))return '' # WX.notify(soup.FromUserName.string)return '' return ''

問題解答

回答1:

你好,請問這個問題你解決了嗎?是怎么解決的呢?我現(xiàn)在也遇到了這個問題,不知道怎么辦呢,求助

標簽: 微信 Python
相關文章: