mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:19:26 +08:00
update
This commit is contained in:
+4
-3
@@ -46,7 +46,7 @@ except:
|
||||
app.config['SESSION_FILE_THRESHOLD'] = 1024
|
||||
app.config['SESSION_FILE_MODE'] = 384
|
||||
|
||||
app.config['SESSION_PERMANENT'] = True
|
||||
app.config['SESSION_PERMANENT'] = False
|
||||
app.config['SESSION_USE_SIGNER'] = True
|
||||
app.config['SESSION_KEY_PREFIX'] = 'MW_:'
|
||||
app.config['SESSION_COOKIE_NAME'] = "MW_VER_1"
|
||||
@@ -117,10 +117,11 @@ def checkLogin():
|
||||
|
||||
@app.route("/login")
|
||||
def login():
|
||||
|
||||
print session
|
||||
dologin = request.args.get('dologin', '')
|
||||
if dologin == 'True':
|
||||
session.clear()
|
||||
return redirect('/login')
|
||||
|
||||
if isLogined():
|
||||
return redirect('/')
|
||||
@@ -162,7 +163,7 @@ def index(reqClass=None, reqAction=None, reqData=None):
|
||||
classFile = ('config', 'control', 'crontab', 'files', 'firewall',
|
||||
'index', 'plugins', 'login', 'system', 'site', 'task', 'soft')
|
||||
if not reqClass in classFile:
|
||||
return '403 no access!'
|
||||
return redirect('/')
|
||||
|
||||
if reqAction == None:
|
||||
if not isLogined():
|
||||
|
||||
@@ -209,7 +209,9 @@ $('#login-button').click(function(){
|
||||
$.post('/do_login',data,function(rdata){
|
||||
layer.close(loadT);
|
||||
if(!rdata.status){
|
||||
if(username == 'admin' && rdata.msg.indexOf('用户名') != -1) rdata.msg += ', <br>获取默认用户和密码命令: mw default';
|
||||
if(username == 'admin' && rdata.msg.indexOf('用户名') != -1){
|
||||
rdata.msg += ', <br>获取默认用户和密码命令: mw default';
|
||||
}
|
||||
$("#errorStr").html(rdata.msg);
|
||||
$("input[name='password']").val('');
|
||||
num = rdata.msg.substring(rdata.msg.indexOf('[')+1,rdata.msg.indexOf(']'))
|
||||
|
||||
Reference in New Issue
Block a user