blackmatrix7 / dingtalk-python Goto Github PK
View Code? Open in Web Editor NEW钉钉第三方SDK,Python版本
License: Apache License 2.0
钉钉第三方SDK,Python版本
License: Apache License 2.0
请问钉钉用户使用账户登录和扫码登录如何实现?
(●─●)。翻遍所有文档没看到相关内容。首先我不是企业管理员。我只想在群组里收到 at 的时候自动 回复 "收到,我已在处理中"。
aes_key: ZC5MWOE8inNkJRbUw3ay9OXl27bnd0SLqXTwfAIqgir
ciphertext: JVjyp8Sgojp6I1oLHA96uc8i/sXsvpmvyVjkxh6jwbP20m2IeoJCkAt/60k80IrqhiPi2ZEobPL+VZa14lj0mw==
调用crypto.py里的decrypt会出错:
File "。。。。/callback/crypto.py", line 111, in
ciphertext='JVjyp8Sgojp6I1oLHA96uc8i/sXsvpmvyVjkxh6jwbP20m2IeoJCkAt/60k80IrqhiPi2ZEobPL+VZa14lj0mw=='))
File "。。。/callback/crypto.py", line 85, in decrypt
length = struct.unpack('!i', raw[16:20])[0]
struct.error: unpack requires a buffer of 4 bytes
调试了一下,发现应该是pkcs7_unpad把信息搞丢了:
pkcs7_unpad之前信息为:
b'AfkpTLMLSlYN7Iuz\x00\x00\x00\x0cheollo worldding02323e3f1d13ae10\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c'
之后为:
AfkpTLMLSlYN7Iuz\x00\x00\x00
注意到\x0c第一次出现在msg前,即位置19处,所以pkcs7_unpad把后面的消息都截取掉了。
我没有研究过具体加密和解密的算法,我这边为了保证信息不会被截取,把pkcs7_unpad方法改了一下:
return text[: text.index(text[-1], 20)]
有懂算法的可以看看这样是否合适。
file 这个模块,你是说主要针对于钉盘,
能再多介绍一下,我想要实现一个自动下载的功能。
放在web.py 里面,运行时出现异常 ImportError: cannot import name 'JSONDecodeError'
请问这是什么问题呢?
File "E:\HardPython\projects\DingAppServer\webapi.py", line 118, in GET
from dingtalk import DingTalkApp
File "E:\HardPython\projects\DingAppServer\dingtalk_init_.py", line 13, in
from .message import Message
File "E:\HardPython\projects\DingAppServer\dingtalk\message_init_.py", line 8, in
from .conversation import *
File "E:\HardPython\projects\DingAppServer\dingtalk\message\conversation.py", line 11, in
from json import JSONDecodeError
ImportError: cannot import name 'JSONDecodeError'
实现了新版免登方案,可通过 appkey 和 appsecret 获取到 access_token。已发起 MR。
1、env
python 3.5.2
2、现象
回调接口返回数据:
{"msg_signature": "f2b351fe2f0635b80b2f4c8b4bac2b34ff6c294c", "nonce": "12345", "timeStamp": "1551773340805", "encrypt": "h4FvNBrDtsJf8FoOjWB/v9OcpwFtXqFfVLVmfCb/nVer50qXdjFnwOVflT9+rUSp11a+hcyW7zI49IjfgMVEFA=="}
返回结果
{'errcode': 71009, 'errmsg': '返回文本非success'}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.