Page 127 - Node.js开发指南
P. 127

120  第 5 章  使用 Node.js 进行 Web 开发


                       <div class="controls">
                         <input type="text" class="input-xlarge" id="username" name="username">
                       </div>
                     </div>
                     <div class="control-group">
                       <label class="control-label" for="password">口令</label>
                       <div class="controls">
                         <input type="password" class="input-xlarge" id="password" name="password">
                       </div>
                     </div>
                     <div class="form-actions">
                       <button type="submit" class="btn btn-primary">登入</button>
                     </div>
                   </fieldset>
                 </form>
                 在浏览器中访问http://localhost:3000/login,你将会看到如图5-13 所示的页面。
































                                                图5-13  用户登入

                 至此用户注册和登录的功能就完全实现了。

             5.6.4  页面权限控制

                 在前面我们已经实现了用户登入,并且在页面中通过不同的内容反映出了用户已登入和
   122   123   124   125   126   127   128   129   130   131   132