mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:19:26 +08:00
Update __init__.py
This commit is contained in:
@@ -91,6 +91,12 @@ def isLogined():
|
||||
# print('isLogined', session)
|
||||
if 'login' in session and 'username' in session and session['login'] == True:
|
||||
return True
|
||||
|
||||
if os.path.exists('data/api_login.txt'):
|
||||
content = mw.readFile('data/api_login.txt')
|
||||
session['login'] = True
|
||||
session['username'] = content
|
||||
os.remove('data/api_login.txt')
|
||||
return False
|
||||
|
||||
|
||||
@@ -205,6 +211,9 @@ def doLogin():
|
||||
session['login'] = True
|
||||
session['username'] = userInfo['username']
|
||||
#print('do_login', session)
|
||||
|
||||
# fix 跳转时,数据消失,可能是跨域问题
|
||||
mw.writeFile('data/api_login.txt', userInfo['username'])
|
||||
return mw.returnJson(True, '登录成功,正在跳转...')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user