<reponame>Hustport/Hustport
#encoding: utf-8

from functools import wraps
from flask import session, redirect, url_for

#登陆限制的装饰器
def login_required(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        if session.get('stu_id'):
            return func(*args, **kwargs)
        else:
            return redirect(url_for('index'))
    return wrapper


#encoding: utf-8

from functools import wraps
from flask import session, redirect, url_for

#登陆限制的装饰器
def login_required(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        if session.get('stu_id'):
            return func(*args, **kwargs)
        else:
            return redirect(url_for('index'))
    return wrapper
#encoding: utf-8 #登陆限制的装饰器