修改钉钉/企业微信直接使用内部应用免密登录的方式来验证,不再支持扫码。

由于一些API的权限发生变化,导致一些关键信息无法获取,所以做以上改变。
删除了无用的代码,其它没啥变化,没太多时间重写,先就这么着吧。
This commit is contained in:
Leven
2022-12-20 13:20:40 +08:00
parent 2e886dc6e8
commit c5bc154924
11 changed files with 69 additions and 205 deletions

View File

@@ -1,19 +1,17 @@
import datetime
from cryptography.fernet import Fernet
import sys
from django_redis import get_redis_connection
from utils.storage.kvstorage import KvStorage
from utils.storage.memorystorage import MemoryStorage
import datetime
from traceback import format_exc
try:
redis_conn = get_redis_connection()
cache_storage = KvStorage(redis_conn)
cache_storage.set('redis_connection', str(datetime.datetime.now()))
redis_get = cache_storage.get('redis_connection')
# print("Redis连接成功set/get测试通过--{}Token缓存将使用Redis处理".format(redis_get))
except Exception as e:
cache_storage = MemoryStorage()
print("Redis无法连接Token缓存将使用MemoryStorage处理")
print("如果确定需要使用Redis作为缓存请排查Redis配置错误信息如下")
print("Redis Exception: {}".format(e))
crypto_key = Fernet.generate_key()
print("请排查Redis配置错误信息如下")
print("Redis Exception: {}".format(format_exc()))
sys.exit(1)