Update index.py

This commit is contained in:
Mr Chen
2024-05-05 18:21:50 +08:00
parent 8d27ffbe91
commit 4a023531e4
+1 -1
View File
@@ -197,10 +197,10 @@ def mongdbClient():
auth = getConfAuth()
ip = getConfIp()
mg_root = pSqliteDb('config').where('id=?', (1,)).getField('mg_root')
# print(ip,port,auth,mg_root)
if auth == 'disabled':
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True)
else:
# print(auth,mg_root)
# uri = "mongodb://root:"+mg_root+"@127.0.0.1:"+str(port)
# client = pymongo.MongoClient(uri)
client = pymongo.MongoClient(host=ip, port=int(port), directConnection=True, username='root',password=mg_root)