Node.js部落格系統--14.後臺管理-註冊使用者資料展示
阿新 • • 發佈:2019-02-15
在“使用者管理”中新增路由
引入資料,傳遞給user_index頁面
user_index內容
user_index.html
{% extends 'layout.html' %} {% block main %} <ol class="breadcrumb"> <li><a href="#">管理首頁</a></li> <li>使用者列表</li> </ol> <h3>使用者列表</h3> <table class="table table-hover table-striped"> <tr> <th>ID</th> <th>使用者名稱</th> <th>密碼</th> <th>是否是管理員</th> </tr> {% for user in users %} <tr> <td>{{user._id.toString()}}</td> <td>{{user.username}}</td> <td>{{user.password}}</td> <td> {%if user.isAdmin%}是{% endif %} </td> </tr> {% endfor %} </table> {% include 'page.html' %} {% endblock %}
看一下效果