python - 已關注粉絲再次掃描微信帶參數二維碼報錯
問題描述
已關注粉絲再次掃描微信帶參數二維碼報錯。未關注粉絲掃描二維碼時,正常。第二次掃描時,提示“無法服務”
查后臺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:你好,請問這個問題你解決了嗎?是怎么解決的呢?我現在也遇到了這個問題,不知道怎么辦呢,求助
相關文章:
1. docker安裝后出現Cannot connect to the Docker daemon.2. 為什么我ping不通我的docker容器呢???3. nignx - docker內nginx 80端口被占用4. docker - 如何修改運行中容器的配置5. Docker for Mac 創建的dnsmasq容器連不上/不工作的問題6. docker鏡像push報錯7. angular.js - angular內容過長展開收起效果8. docker-compose中volumes的問題9. 關docker hub上有些鏡像的tag被標記““This image has vulnerabilities””10. dockerfile - 為什么docker容器啟動不了?
