mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update common.py
This commit is contained in:
@@ -32,6 +32,7 @@ from flask import redirect
|
||||
|
||||
|
||||
def init():
|
||||
initSystemControl()
|
||||
initDB()
|
||||
initDBSshPort()
|
||||
initUserInfo()
|
||||
@@ -146,17 +147,20 @@ def initInitTask():
|
||||
|
||||
|
||||
def initSystemControl():
|
||||
path = 'data/default.db'
|
||||
if os.path.exists(path):
|
||||
return False
|
||||
|
||||
import system_api
|
||||
sapi = system_api.system_api()
|
||||
sapi.setControl(1, 30)
|
||||
r = sapi.setControl(1, 30)
|
||||
print(r)
|
||||
|
||||
|
||||
def initUserInfo():
|
||||
|
||||
data = mw.M('users').where('id=?', (1,)).getField('password')
|
||||
if data == '21232f297a57a5a743894a0e4a801fc3':
|
||||
# 默认监控开启
|
||||
initSystemControl()
|
||||
|
||||
pwd = mw.getRandomString(8).lower()
|
||||
file_pw = mw.getRunDir() + '/data/default.pl'
|
||||
|
||||
Reference in New Issue
Block a user