Flask 密码重设系统【源码来自编程浪子Flask点餐小程序】
web/templates/user/reset_pwd.html
python
{% extends "common/layout_main.html" %}
{% block content %}
{% include "common/tab_user.html" %}
<div class="row m-t user_reset_pwd_wrap">
<div class="col-lg-12">
<h2 class="text-center">修改密码</h2>
<div class="form-horizontal m-t m-b">
<div class="form-group">
<label class="col-lg-2 control-label">账号:</label>
<div class="col-lg-10">
<label class="control-label">{{ current_user.login_name }}</label>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-lg-2 control-label">手机:</label>
<div class="col-lg-10">
<label class="control-label">{{ current_user.mobile }}</label>
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-lg-2 control-label">原密码:</label>
<div class="col-lg-10">
<input type="password" id="old_password" class="form-control" value="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<label class="col-lg-2 control-label">新密码:</label>
<div class="col-lg-10">
<input type="password" id="new_password" class="form-control" value="">
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group">
<div class="col-lg-4 col-lg-offset-2">
<button class="btn btn-w-m btn-outline btn-primary" id="save">保存</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block js %}
<script src="{{ buildStaticUrl('/js/user/reset_pwd.js') }}"></script>
{% endblock %}
这段代码是一个基于Flask框架的模板文件,用于实现一个修改密码的功能页面。下面是对代码的解析:
-
首先,代码使用了Flask的模板继承功能,通过{% extends "common/layout_main.html" %}指定了继承的父模板文件为common/layout_main.html。
-
在{% block content %}和{% endblock %}之间的代码是该页面的内容部分。其中,{% include "common/tab_user.html" %}用于引入名为common/tab_user.html的子模板文件。
-
页面的主体部分是一个包含表单的
标签,具有class="row m-t user_reset_pwd_wrap"的样式。表单中包含了多个表单项,每个表单项都由一个
标签包裹。每个表单项包含一个
相关推荐
脚本自动化开发4 小时前
存储涨价后,磐镭WO5迷你主机值得买吗一只爱撸猫的程序猿6 小时前
我看着一个 AI 引擎在 14 天里,从"记忆"走进了"搜索"陈随易9 小时前
纯 Go 写的 JS 引擎,跑分超过了 C 语言的 QuickJS卷无止境10 小时前
RAGFlow 项目全景报告:从文档解析引擎到 Agent 原生数据库小Z先生10 小时前
我用 Go + 系统 WebView 写了个纯本地 Postman:不装 Electron、不连云端IT_陈寒11 小时前
Redis连接池泄漏那次,我差点把生产环境搞崩了灿飞屋11 小时前
Kotlin与Java虚拟机三:控制流benchmark_cc11 小时前
单只股票五档盘口接入个人研究仓库:QuantDash 读取、校验与易错点石小石Orz11 小时前
AI 正在蚕食我们的编码能力陈随易11 小时前
专注飞机 FocusFlight,两个人把番茄钟做成了一趟航班