mirror of
https://github.com/capricornxl/ad-password-self-service.git
synced 2025-11-11 12:36:09 +08:00
修改钉钉/企业微信直接使用内部应用免密登录的方式来验证,不再支持扫码。
由于一些API的权限发生变化,导致一些关键信息无法获取,所以做以上改变。 删除了无用的代码,其它没啥变化,没太多时间重写,先就这么着吧。
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user