This commit is contained in:
yumoqing 2024-11-25 14:42:21 +08:00
parent bc883e3b86
commit ca8fcbdca9

View File

@ -28,6 +28,7 @@ from appPublic.unicoding import unicoding,uDict,uObject
from appPublic.Singleton import SingletonDecorator from appPublic.Singleton import SingletonDecorator
from appPublic.rc4 import password from appPublic.rc4 import password
from appPublic.registerfunction import RegisterFunction from appPublic.registerfunction import RegisterFunction
from appPublic.httpclient import HttpClient
from sqlor.dbpools import DBPools,runSQL,runSQLPaging from sqlor.dbpools import DBPools,runSQL,runSQLPaging
from sqlor.filter import DBFilter, default_filterjson from sqlor.filter import DBFilter, default_filterjson
@ -41,6 +42,12 @@ from .filetest import current_fileno
from .filestorage import FileStorage from .filestorage import FileStorage
from .serverenv import ServerEnv from .serverenv import ServerEnv
def basic_auth_headers(user, passwd):
ba = BasicAuth(login=user, password=passwd)
return {
"Authorization":ba.encode()
}
def data2xlsx(rows,headers=None): def data2xlsx(rows,headers=None):
wb = Workbook() wb = Workbook()
ws = wb.active ws = wb.active
@ -211,6 +218,8 @@ def initEnv():
g.save_file = save_file g.save_file = save_file
g.realpath = realpath g.realpath = realpath
g.format_exc = format_exc g.format_exc = format_exc
g.basic_auth_headers = basic_auth_headers
g.HttpClient = HttpClient
g.rfexe = RegisterFunction().exe g.rfexe = RegisterFunction().exe
def set_builtins(): def set_builtins():