FocusFlow α Sprint Blog Series (Part 1) - Login and Personal Center Module Report

FOCUS_2025_SE 2025-12-13 22:16:13

目录

  • Project Overview
  • 1. Sprint Burndown Chart
  • 2. Function realization demonstration
  • 2.1 User Login Module
  • 2.2 Personal Center Module
  • 3. Code Check-in Records (GitHub Commits)
  • 4. Core code analysis
  • 4.1 Login Verification Logic (app.py)
  • 4.2 Personal Information Update Logic (app.py)
  • 5. Sprint Summary
  • Completed tasks:
  • Problems Encountered and Solutions:
  • Problems:
  • Solution:

Project Overview

Course2501_MU_SE_FZU
Assignment RequirementFifth Assignment - Alpha Sprint
Team NameFocus_2025
Goal of this assignmentClarify Code Standards, Sprint Tasks, and Plans for the team Alpha Sprint
Other referencesIEEE Std 830-1998, GB/T 8567-2006

Author: He Jiazhuo
Completion Date: December 13, 2025

1. Sprint Burndown Chart

img

2. Function realization demonstration

This sprint, I was mainly responsible for implementing the two core modules: user login and personal center. Below are screenshots showing the operation of the functions.

2.1 User Login Module

This module implements the identity verification process based on mobile phone number, password and dynamic verification code.

login interface

在这里插入图片描述

Login success/failure prompt:

在这里插入图片描述


在这里插入图片描述

2.2 Personal Center Module

This module offers users the core functions of information viewing and management, including personal information modification and account security settings.

·Personal Center Homepage:

在这里插入图片描述


在这里插入图片描述


在这里插入图片描述


Explanation: The page clearly displays the user's profile picture (generated dynamically from the initial letter of the name), basic information, educational background, this month's check-in data, and the check-in calendar for the past 30 days.

·Modify personal information:

在这里插入图片描述


在这里插入图片描述

Explanation: Clicking the "Edit" button will open a modal box, allowing users to modify information such as name, phone number, email, gender, birthday, school, educational level and grade. The username/login name (mobile phone number) is the key credential and cannot be directly modified here.

·Password modification functionInstruction:

在这里插入图片描述


在这里插入图片描述


Click the "Change Password" button to open the password modification panel. To ensure security, the new password must be verified against the current password, and it is also required that the new password be the same as the confirmed password.

3. Code Check-in Records (GitHub Commits)

Explanation: As the person in charge of the "Login and Personal Center" module, I completed the entire development of this module from the front-end interface to the back-end logic. The main code changes were concentrated in the following files, and these changes have been integrated into the main branch of the project.
Core backend logic (app.py): It implements core routing functions such as login(), profile(), update_profile(), and change_password().
Front-end page templates (templates/login.html, templates/profile.html): These templates have constructed the user interaction interface.
Database and Models (models.py, database.py): Supports the storage and validation of user data.
Due to the reasons of the development process and local environment configuration, the detailed commit hashes could not be listed one by one in this report. All the code contributions for this sprint can be viewed and traced through the Commits history page of the project repository.

4. Core code analysis

4.1 Login Verification Logic (app.py)

@app.route('/login', methods=['GET', 'POST'])
def login():
    if request.method == 'POST':
        phone = request.form.get('phone')
        password = request.form.get('password')
        user_captcha = request.form.get('captcha')
        correct_answer = session.get('captcha_answer', '')
 
        # 1. 验证码校验
        if user_captcha != correct_answer:
            flash(‘Captcha answer WRONG!’)
            return render_template(‘login.html’, ...)
 
        conn = get_db_connection()
        user = conn.execute(‘SELECT * FROM users WHERE phone = ?’, (phone,)).fetchone()
 
        # 2. 用户存在性及密码校验 (使用flask_bcrypt)
        if user and bcrypt.check_password_hash(user[‘password’], password):
            session[‘user_id’] = user[‘id’]  # 设置会话
            flash(‘Login SUCCESS!’)
            return redirect(url_for(‘dashboard’))
        else:
            flash(‘User NOT FOUND or Password WRONG!’)
        conn.close()

4.2 Personal Information Update Logic (app.py)

# 示例代码摘录自 app.py 的 update_profile() 路由函数
@app.route(‘/update_profile‘, methods=[’POST‘])
@login_required
def update_profile():
    user_id = session[’user_id‘]
    # 从表单安全获取数据
    first_name = request.form.get(’first_name‘)
    last_name = request.form.get(’last_name‘)
    email = request.form.get(’email‘)
    # ... 获取其他字段
 
    conn = get_db_connection()
    # 执行数据库更新
    conn.execute(’’‘
        UPDATE users
        SET first_name=?, last_name=?, email=?, ...
        WHERE id=?
    ’’’, (first_name, last_name, email, ..., user_id))
    conn.commit()
    conn.close()
    flash(‘Profile updated successfully!’)
    return redirect(url_for(’profile‘))

5. Sprint Summary

Completed tasks:

Login module: Completed the entire login process both on the front end and the back end, including forms with verification codes, secure password verification (using Bcrypt hashing), session management, and friendly prompts. Personal Center Module: It has realized a complete set of functions including displaying personal homepage information, visualizing the sign-in calendar, editing personal information, and modifying the password (requiring verification of the original password). Issue Resolution: The problem of ModuleNotFoundError that occurred during project startup due to the absence of the utils.helpers module has been resolved. A temporary solution was implemented to ensure the project's operability, facilitating team testing.

Problems Encountered and Solutions:

Problems:

  1. During the initial startup, the errors "ModuleNotFoundError: No module named 'flask_bcrypt'" and "ModuleNotFoundError: No module named 'utils.helpers'" occurred.

Solution:

  1. Install the missing dependency package by using the command "pip install flask-bcrypt bcrypt".
  2. Upon inspection, it was found that the project code was incomplete, lacking the utils/helpers.py file. To avoid disrupting the development process, the relevant import lines were temporarily commented out in app.py, and the avatar generation logic was hardcoded to ensure that the core functions (login, personal center) could be demonstrated and tested. This issue has been reported to the team and will be supplemented with the complete file in the future.
...全文
199 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
内容概要:本文围绕基于三电平ANPC-VSG(虚拟同步发电机)的构网型逆变器控制展开研究,重点设计并实现了双闭环控制与中点电位平衡控制策略。通过Simulink仿真实现,验证了该控制体系在提升逆变器并网性能方面的有效性。系统采用虚拟同步发电机技术,使逆变器具备类似同步电机的惯量与阻尼特性,显著增强电网稳定性;结合电压外环与电流内环构成的双闭环控制结构,实现对输出电压和电流的精确动态调节与高稳态精度;同时,针对三电平拓扑中存在的中点电位漂移问题,引入有效的平衡控制算法,确保母线电压对称,保障系统安全可靠运行。整体方案不仅支持电压、频率的自主恢复,还能实现功率的合理分配,特别适用于高比例新能源接入的弱电网或孤岛运行环境。; 适合人群:电气工程、电力电子与电力系统相关专业的研究生、科研人员及从事新能源并网逆变器开发的高级工程师。; 使用场景及目标:①应用于高比例可再生能源电网中构网型逆变器的设计与仿真;②实现三电平ANPC逆变器在孤岛或弱电网条件下的稳定并网运行;③解决中点电位不平衡问题,提升多电平逆变器的电能质量和运行可靠性;④为VSG控制、双闭环设计及中点电位控制提供完整的理论依据与仿真验证平台。; 阅读建议:此资源以Simulink仿真为核心,建议读者结合文中控制策略进行模型复现,重点关注双闭环参数整定、VSG惯量阻尼系数设置及中点电位平衡算法的实现细节,并通过稳态、动态与不平衡工况下的仿真结果分析系统性能。
内容概要:本文研究了基于二阶锥双层凸规划的分布式风光与电动汽车协同调压降损调度方法,旨在通过优化调度策略实现配电网的电压稳定与网损降低。研究构建了一个包含分布式光伏、风力发电及电动汽车V2G(Vehicle-to-Grid)能力的多时段协同优化模型,采用二阶锥松弛技术将原本非凸非线性的复杂优化问题转化为可高效求解的凸优化问题,并通过Matlab编程实现了算法仿真与验证。文中系统阐述了模型的数学建模过程,包括以最小化网络损耗和电压偏差为目标的目标函数设计,以及涵盖功率平衡、节点电压范围、设备容量限制等在内的多重约束条件。结合标准算例进行仿真分析,结果表明所提出的调度方法在改善配电网电压质量、降低网络损耗方面具有显著效果,尤其适用于高比例可再生能源与大规模电动汽车接入的复杂运行场景。该研究为现代智能配电网的安全、经济、高效运行提供了坚实的理论依据与可行的技术路径。; 适合人群:具备电力系统分析、优化理论基础及Matlab编程能力的研究生、科研人员,以及从事智能电网、分布式能源系统规划与运行、电动汽车与电网互动(V2G)等领域的工程技术人员。; 使用场景及目标:①应用于高渗透率新能源与电动汽车共同接入背景下的配电网多时段协同调度仿真与优化;②支撑科研工作者对二阶锥规划(SOCP)、双层优化建模范式的复现、学习与改进;③为电力系统运行部门提供一套切实可行的节能降损、电压稳定控制的技术方案参考,助力新型电力系统建设;④作为高级调度算法的教学案例,深化对现代优化技术在电力系统中应用的理解。; 阅读建议:读者应结合文中的数学模型推导与提供的Matlab代码进行对照学习,重点掌握二阶锥松弛技术的应用技巧、双层优化问题的分解策略与求解逻辑,建议动手调试代码以深入理解各约束条件与目标函数项的实际作用机制,并可在此基础上进一步拓展至多目标优化、不确定性优化(如鲁棒优化、随机规划)或考虑通信延迟等更复杂的实际因素。
内容概要:本文针对电动汽车充电站接入背景下配电网承载能力的评估与优化问题,提出了一套完整的Matlab代码实现方案。研究构建了包含电动汽车渗透率、分布式光伏出力、SVC无功补偿等多类型资源协同作用的配电网基础模型,并建立了涵盖一次设备安全、负荷平稳性、电能质量和系统效率的多维评价指标体系。在此基础上,采用熵权法客观赋权与模糊综合评价相结合的双层评分模型,对不同渗透率场景下的配电网承载能力进行量化评估,通过算例仿真分析各指标的变化规律与灵敏度,验证了方法的有效性与实用性。; 适合人群:具备电力系统基础知识和Matlab编程能力,从事新能源接入、配电网规划与优化相关研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①用于评估高比例电动汽车接入对配电网运行安全性与电能质量的影响;②为配电网扩容改造、充电站规划布局提供量化决策依据;③支撑多类型分布式资源协同优化调度的研究与仿真验证。; 阅读建议:建议结合文中目录结构,重点研读模型构建与评价体系部分,运行提供的Matlab代码以复现仿真结果,并可根据实际需求修改参数设置,拓展至含储能、V2G等更复杂场景的应用。

164

社区成员

发帖
与我相关
我的任务
社区描述
2501_MU_SE_FZU
软件工程 高校
社区管理员
  • FZU_SE_LQF
  • 助教_林日臻
  • 朱仕君
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧