﻿#!/usr/bin/env python
# -*- coding: utf-8 -*-
import web
from functools import wraps 
def login_required(func):
    @wraps(func)
    def check_session(*args, **kwargs):
        if web.cookies().get('username'):
            return  func(*args, **kwargs)
        else:
        	raise web.seeother('/login')
    return check_session
00ededc23193315a17f3e7abceb1a2c8a1851a06
﻿#!/usr/bin/env python
# -*- coding: utf-8 -*-
import web
from functools import wraps 
def login_required(func):
    @wraps(func)
    def check_session(*args, **kwargs):
        if web.cookies().get('username'):
            return  func(*args, **kwargs)
        else:
        	raise web.seeother('/login')
    return check_session