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. java - 安卓電視盒子取得了root權(quán)限但是不能安裝第三方應(yīng)用,請(qǐng)問(wèn)該怎么辦?2. 在MySQL中新增字段時(shí),報(bào)錯(cuò)??3. 老哥們求助啊4. python - 模擬滑動(dòng)驗(yàn)證碼,有源碼,求解5. javascript - js 寫(xiě)一個(gè)正則 提取文本中的數(shù)據(jù)6. css3 - 請(qǐng)問(wèn)一下在移動(dòng)端CSS布局布局中通常需要用到哪些元素,屬性?7. npm鏡像站全新上線8. javascript - vue-router怎么不能實(shí)現(xiàn)跳轉(zhuǎn)呢9. javascript - [WDS] Disconnected! 一直重復(fù)出現(xiàn)。10. html5 - angularjs中外部模版加載無(wú)法使用
