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.
...全文
177 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复
源码下载地址: https://pan.quark.cn/s/6368ecfb96b2 将 USB 扫描设备转换为虚拟串口的过程涉及将该设备接入计算机系统,并将其转变为虚拟串行接口,以便在计算平台中进行操作。以下将系统性地阐释 USB 扫描设备转换为虚拟串口的配置步骤。首要步骤:驱动程序安装在进行配置之前,必须首先完成扫描设备的驱动程序安装工作。将包含驱动内容的光盘置入光驱,打开后定位至 Symbol+COM+Port+Emulation+Driver+v+1.8.5.zip 压缩文件,解压缩后执行安装操作。该压缩文件内含所有必需的驱动组件及工具,旨在协助完成扫描设备的驱动安装与配置。第二步:设备接入完成驱动程序安装后,需将扫描设备安装至工业控制计算机上。该扫描设备通过 USB 接口实现连接,可安置于工业控制计算机上任何空闲的 USB 端口。设备接入工业控制计算机后,将自动执行扫描设备的驱动程序安装。驱动程序安装完毕后,扫描设备会发出提示性鸣响。第三步:虚拟串口配置扫描设备安装结束后,需进行虚拟串口的设置工作。首先利用扫描设备扫描 USB 至串口转换码,具体如图所示。接着,通过电脑的“开始”菜单路径依次访问“我的电脑”->“属性”->“硬件”->“设备管理器”->“人体学输入设备”。在人体学输入设备列表中,选中 Communication Virtual Port COM 口,右键打开属性 ->Port Setting->Advanced。在 Advanced Settings for COM 窗口中,将 COM Port Number 更改为 COM6。虚拟串口的功能与应用虚拟串口是计算机系统内的一种特殊接口类型,其作用在于模拟串口的功能表现。通过实施虚拟串口...

164

社区成员

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

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