|
|
@ -30,7 +30,7 @@ def on_message(client, userdata, msg):
|
|
|
|
print("收到响应: "+str(msg.topic) + str(msg.payload))
|
|
|
|
print("收到响应: "+str(msg.topic) + str(msg.payload))
|
|
|
|
|
|
|
|
|
|
|
|
if msg.topic == "image/{}".format(user_id):
|
|
|
|
if msg.topic == "image/{}".format(user_id):
|
|
|
|
with open("image.jpg", "wb") as f:
|
|
|
|
with open("image/image.jpg", "wb") as f:
|
|
|
|
f.write(msg.payload)
|
|
|
|
f.write(msg.payload)
|
|
|
|
print("图片已保存。")
|
|
|
|
print("图片已保存。")
|
|
|
|
|
|
|
|
|
|
|
|