python - 已關(guān)注粉絲再次掃描微信帶參數(shù)二維碼報(bào)錯
問題描述
已關(guān)注粉絲再次掃描微信帶參數(shù)二維碼報(bào)錯。未關(guān)注粉絲掃描二維碼時(shí),正常。第二次掃描時(shí),提示“無法服務(wù)”
查后臺nginx日志 兩種場景均返回的為空,CODE 為200
@app.route('/',methods=['POST','GET','PUT'])def index(): if(request.method=='GET'): #驗(yàn)證微信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)在也遇到了這個問題,不知道怎么辦呢,求助
相關(guān)文章:
1. 求救一下,用新版的phpstudy,數(shù)據(jù)庫過段時(shí)間會消失是什么情況?2. linux運(yùn)維 - python遠(yuǎn)程控制windows如何實(shí)現(xiàn)3. javascript - 從mysql獲取json數(shù)據(jù),前端怎么處理轉(zhuǎn)換解析json類型4. django - Python error: [Errno 99] Cannot assign requested address5. android - 安卓做前端,PHP做后臺服務(wù)器 有什么需要注意的?6. python小白 關(guān)于類里面的方法獲取變量失敗的問題7. mysql - ubuntu開啟3306端口失敗,有什么辦法可以解決?8. thinkPHP5中獲取數(shù)據(jù)庫數(shù)據(jù)后默認(rèn)選中下拉框的值,傳遞到后臺消失不見。有圖有代碼,希望有人幫忙9. extra沒有加載出來10. python - Scrapy如何得到原始的start_url
