Skip to content

Commit

Permalink
2024年10月22日 超管开启MFA功能
Browse files Browse the repository at this point in the history
  • Loading branch information
ss1917 committed Oct 22, 2024
1 parent 6fdb54b commit 94db2e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mg/handlers/token_v4_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def post(self, *args, **kwargs):
with DBContext('r') as session:
user_info = session.query(Users).filter(Users.id == user_id).first()

if user_info.superuser == '0':
return self.write(dict(code=-4, msg='超级用户不能生成长期令牌'))
# if user_info.superuser == '0':
# return self.write(dict(code=-4, msg='超级用户不能生成长期令牌'))

# 生成token
is_superuser = True if user_info.superuser == '0' else False
Expand Down
4 changes: 3 additions & 1 deletion models/authority.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Base = declarative_base()


class Users(TimeBaseModel, Base):
class Users(Base):
__tablename__ = 'codo_a_users'

# 用户表
Expand All @@ -38,6 +38,8 @@ class Users(TimeBaseModel, Base):
fs_id = Column('fs_id', String(180), default='') # 飞书ID
ext_info = Column('ext_info', JSON(), default={}, comment='扩展字段存JSON') # 扩展字段
##
create_time = Column(DateTime, nullable=False, default=datetime.now) # 记录的创建时间
update_time = Column(DateTime, nullable=False, default=datetime.now, index=True) # 更新时间
last_ip = Column('last_ip', String(20), default='')
last_login = Column('last_login', DateTime(), default=datetime.now, onupdate=datetime.now)

Expand Down

0 comments on commit 94db2e2

Please sign in to comment.