Compare commits

...

10 Commits

Author SHA1 Message Date
zdl
95f20e3049 Merge branch 'develop' 2025-10-21 11:02:16 +08:00
zdl
7cca5e73c0 Merge branch 'feature' into develop 2025-10-21 11:02:02 +08:00
zdl
f9ed6c19de Merge branch 'develop'
# Conflicts:
#	app.py
2025-10-17 15:07:34 +08:00
zdl
112fbbd42d Merge branch 'feature' into develop 2025-10-17 15:01:54 +08:00
d4f813d58e api/auth/wechat/qrcode接口外包裹 2025-10-16 07:05:13 +08:00
05063374c0 Merge branch 'main' of https://git.valuefrontier.cn/vf/vf_react
修改/api/auth/register/phone
2025-10-16 07:01:45 +08:00
dac966e2d8 修改/api/auth/register/phone中要求用户名密码的逻辑 2025-10-16 07:01:25 +08:00
zdl
3a4dade8ec Merge branch 'main' into develop 2025-10-15 21:01:59 +08:00
zdl
6f81259f8c feat: 解决导航跳转失效的问题 2025-10-15 11:57:28 +08:00
zdl
864844a52b feat: 10.10线上最新代码提交 2025-10-15 11:56:34 +08:00

25
app.py
View File

@@ -2123,10 +2123,8 @@ def register_with_phone():
data = request.get_json() data = request.get_json()
phone = data.get('phone') phone = data.get('phone')
code = data.get('code') code = data.get('code')
password = data.get('password')
username = data.get('username')
if not all([phone, code, password, username]): if not all([phone, code]):
return jsonify({'success': False, 'error': '所有字段都是必填的'}), 400 return jsonify({'success': False, 'error': '所有字段都是必填的'}), 400
# 验证验证码 # 验证验证码
@@ -2137,14 +2135,12 @@ def register_with_phone():
if stored_code['code'] != code: if stored_code['code'] != code:
return jsonify({'success': False, 'error': '验证码错误'}), 400 return jsonify({'success': False, 'error': '验证码错误'}), 400
if User.query.filter_by(username=username).first(): if User.query.filter_by(phone=phone).first():
return jsonify({'success': False, 'error': '用户名已存在'}), 400 return jsonify({'success': False, 'error': '手机号已存在'}), 400
try: try:
# 创建用户 # 创建用户
user = User(username=username, phone=phone) user = User(username='用户', phone=phone)
user.email = f"{username}@valuefrontier.temp"
user.set_password(password)
user.phone_confirmed = True user.phone_confirmed = True
db.session.add(user) db.session.add(user)
@@ -2510,13 +2506,12 @@ def get_wechat_qrcode():
'wechat_unionid': None 'wechat_unionid': None
} }
return jsonify({"code":0, return jsonify({'code':0,
"data": 'data':{
{ 'auth_url': wechat_auth_url,
'auth_url': wechat_auth_url, 'session_id': state,
'session_id': state, 'expires_in': 300
'expires_in': 300 }}), 200
}}), 200
@app.route('/api/account/wechat/qrcode', methods=['GET']) @app.route('/api/account/wechat/qrcode', methods=['GET'])