Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
injetlee committed Jun 16, 2018
1 parent 4b8ade3 commit 9baa9de
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions wechat/connect.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*-coding:utf-8 -*-
import falcon
from falcon import uri
from wechatpy.utils import check_signature
Expand Down Expand Up @@ -34,11 +35,11 @@ def on_post(self, req, resp):
resp.body = (xml)
resp.status = falcon.HTTP_200
elif msg.type == 'image':
name = img_download(msg.image, msg.source) # 下载图片
name = img_download(msg.image, msg.source)
print(name)
r = access_api('images/' + name)
if r == '检测成功':
media_id = img_upload('image', 'faces/' + name) # 上传图片,得到 media_id
if r == 'success':
media_id = img_upload('image', 'faces/' + name)
reply = ImageReply(media_id=media_id, message=msg)
else:
reply = TextReply(content='人脸检测失败,请上传1M以下人脸清晰的照片', message=msg)
Expand Down
1 change: 1 addition & 0 deletions wechat/face_id.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*-coding:utf-8 -*-
import time
import random
import base64
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions wechat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os

token = ''
app_id = '微信配置界面的AppID'
secret = '配置界面的开发者密码AppSecret'
app_id = '开发者ID(AppID)'
secret = '开发者密码(AppSecret)'


def img_download(url, name):
Expand Down

0 comments on commit 9baa9de

Please sign in to comment.