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. javascript - vue2如何獲取v-model變量名2. javascript - 求幫助 , ATOM不顯示界面!!!!3. html5 - HTML代碼中的文字亂碼是怎么回事?4. javascript - vue2.0中,$refs對象為什么用駝峰的方式獲取不到屬性?5. python bottle跑起來以后,定時執行的任務為什么每次都重復(多)執行一次?6. 解決Android webview設置cookie和cookie丟失的問題7. javascript - nodejs使用mongoose連接數據庫,使用post提交表單在后臺,后臺處理后調用res.redirect()跳轉界面無效?8. javascript - 能否讓vue-cli的express修改express重啟服務9. python - 爬蟲模擬登錄后,爬取csdn后臺文章列表遇到的問題10. html5 - 急求?被公司問住了
