python - 已關(guān)注粉絲再次掃描微信帶參數(shù)二維碼報(bào)錯(cuò)
問(wèn)題描述
已關(guān)注粉絲再次掃描微信帶參數(shù)二維碼報(bào)錯(cuò)。未關(guān)注粉絲掃描二維碼時(shí),正常。第二次掃描時(shí),提示“無(wú)法服務(wù)”
查后臺(tái)nginx日志 兩種場(chǎng)景均返回的為空,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請(qǐng)求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 ''
問(wèn)題解答
回答1:你好,請(qǐng)問(wèn)這個(gè)問(wèn)題你解決了嗎?是怎么解決的呢?我現(xiàn)在也遇到了這個(gè)問(wèn)題,不知道怎么辦呢,求助
相關(guān)文章:
1. 如何用筆記本上的apache做微信開(kāi)發(fā)的服務(wù)器2. 冒昧問(wèn)一下,我這php代碼哪里出錯(cuò)了???3. php - 淘寶訂單拆單表設(shè)計(jì)4. mysql優(yōu)化 - MySQL如何為配置表建立索引?5. MySQL主鍵沖突時(shí)的更新操作和替換操作在功能上有什么差別(如圖)6. windows誤人子弟啊7. 實(shí)現(xiàn)bing搜索工具urlAPI提交8. 數(shù)據(jù)庫(kù) - Mysql的存儲(chǔ)過(guò)程真的是個(gè)坑!求助下面的存儲(chǔ)過(guò)程哪里錯(cuò)啦,實(shí)在是找不到哪里的問(wèn)題了。9. 我在網(wǎng)址中輸入localhost/abc.php顯示的是not found是為什么呢?10. 關(guān)于mysql聯(lián)合查詢(xún)一對(duì)多的顯示結(jié)果問(wèn)題
