mirror of https://github.com/midoks/mdserver-web
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1018 B
33 lines
1018 B
6 months ago
|
# coding:utf-8
|
||
|
|
||
|
# ---------------------------------------------------------------------------------
|
||
|
# MW-Linux面板
|
||
|
# ---------------------------------------------------------------------------------
|
||
|
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved.
|
||
|
# ---------------------------------------------------------------------------------
|
||
|
# Author: midoks <midoks@163.com>
|
||
|
# ---------------------------------------------------------------------------------
|
||
|
|
||
|
import time
|
||
|
|
||
|
from admin.model import db, TempLogin
|
||
|
|
||
|
import core.mw as mw
|
||
|
|
||
|
def getTempLoginByToken(token,
|
||
|
) -> None:
|
||
|
'''
|
||
|
获取用户信息通过用户名
|
||
|
'''
|
||
|
field = 'id,addtime,expire,login_time,login_addr,state,add_time'
|
||
|
data = mw.M('temp_login').where('token=?', (token,)).field(field).order('id asc').select()
|
||
|
return data
|
||
|
|
||
|
def clearTempLogin()->bool:
|
||
|
'''
|
||
|
清空过期数据
|
||
|
'''
|
||
|
|
||
|
now_time = int(time.time())
|
||
|
mw.M('temp_login').where('expire<?', (now_time)).delete()
|
||
|
return True
|