<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<meta name="description" content="">
<link rel="icon" type="image/png" href="../media/img/default/head.png">
<title>仓鼠公仔管理后台</title>
<!-- CSS -->
<link href="/static/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/css/back.css" rel="stylesheet">
<link href="/static/css/test.css" rel="stylesheet">
</head>
{% block appcontent %}
<body>
<div id="app">
<div class="wrapper">
<div class="leftmenu">
<div class="menutop"><a><img src="../media/img/default/head.jpg" class="logoimg"><h1 class="logotitle">管理后台</h1></a></div>
<div class="menucontent">
<div class="el-scrollbar__wrap">
<div class="el-scrollbar__view">
<ul class="el-menu">
<div><a class="menuone" href="{% url 'welcome' %}" target="iframecss"><li class="menutitle"><img src="../media/img/default/default.jpg"><span>首页</span></li></a></div>
<div>
<li class="el-submenu">
<div class="el-submenu__title " id="sysmanage"><img src="../media/img/default/default.jpg" class="itemimg"><span class="itemspan">系统管理</span><i class="jiantou"></i></div>
<ul class="el-menu--inline " id="sysmanageline" style="display:none;">
<div class="nest-menu"><a href="{% url 'dllist' 1 %}" target="iframecss"><li ><img src="../media/img/default/default.jpg" class="itemimg"><span class="itemspan">代理列表</span></li></a></div>
<div class="nest-menu"><a href="{% url 'cznote' %}" target="iframecss"><li ><img src="../media/img/default/default.jpg" class="itemimg"><span class="itemspan">公告管理</span></li></a></div>
</ul>
</li>
</div>
</ul>
</div>
</div>
<div class="el-scrollbar__bar_horizontal"><div class="el-scrollbar__thumbh"></div></div>
<div class="el-scrollbar__bar_vertical"><div class="el-scrollbar__thumbv"></div></div>
</div>
</div>
<div class="rightcontent">
<div>
<div class="navinfotop">
<div class="navinfotopleft"> 欢迎回来, {{nameinfo.gl_name}}
</div>
<div class="navinfotopright"><div class="headico"><div class="headimg"><img src="../media/img/default/head.jpg"><i class="logouti"></i></div></div></div>
</div>
<div class="navinfobottom"></div>
</div>
<section class="appmain">
<div class="maincontent" style="height:635px;overflow:hidden">
<iframe src="{% url 'welcome' %}" name="iframecss" ></iframe>
</div>
</section>
</div>
</div>
</div>
<ul id="logoutmenu" style="display:none;"><li class="logoutli"><a οnclick="pswset({{nameinfo.id}},1)"><span>改密</span></a></li><li class="logoutli"><a href="/logout"><span>注销</span></a></li></ul>
<div class="v-modal" style="display:none;"></div>
<script src="/static/js/jquery.min.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/boss.js"></script>
<script src="/static/js/test.js"></script>
<script src="/static/js/layer/layer.js"></script>
</body>
{% endblock %}
</html>
对应的views.py
#管理端
def boss(request):
uname=request.session.get("username","")
gl_exist=GLinfo.objects.filter(gl_name=uname)
dl_exist=DLinfo.objects.filter(dl_name=uname)
if gl_exist:
gl_info=GLinfo.objects.get(gl_name=uname)
return render(request,"boss.html",{"nameinfo":gl_info})
elif dl_exist:
dl_info=DLinfo.objects.get(dl_name=uname)
return render(request,"user.html",{"nameinfo":dl_info})
else:
return redirect("/")