Skip to content

Commit 9baa9de

Browse files
committed
fix
1 parent 4b8ade3 commit 9baa9de

5 files changed

+7
-5
lines changed

wechat/connect.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*-coding:utf-8 -*-
12
import falcon
23
from falcon import uri
34
from wechatpy.utils import check_signature
@@ -34,11 +35,11 @@ def on_post(self, req, resp):
3435
resp.body = (xml)
3536
resp.status = falcon.HTTP_200
3637
elif msg.type == 'image':
37-
name = img_download(msg.image, msg.source) # 下载图片
38+
name = img_download(msg.image, msg.source)
3839
print(name)
3940
r = access_api('images/' + name)
40-
if r == '检测成功':
41-
media_id = img_upload('image', 'faces/' + name) # 上传图片,得到 media_id
41+
if r == 'success':
42+
media_id = img_upload('image', 'faces/' + name)
4243
reply = ImageReply(media_id=media_id, message=msg)
4344
else:
4445
reply = TextReply(content='人脸检测失败,请上传1M以下人脸清晰的照片', message=msg)

wechat/face_id.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# -*-coding:utf-8 -*-
12
import time
23
import random
34
import base64
Loading
Loading

wechat/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import os
66

77
token = ''
8-
app_id = '微信配置界面的AppID'
9-
secret = '配置界面的开发者密码AppSecret'
8+
app_id = '开发者ID(AppID)'
9+
secret = '开发者密码(AppSecret)'
1010

1111

1212
def img_download(url, name):

0 commit comments

Comments
 (0)