百木园-与人分享,
就是让自己快乐。

Python---flask框架实现修改密码功能

数据库部分:

1 #重置密码
2 def reset_pass(phone,password):
3 conn,cursor=get_conn()
4 sql=\"update userdata set userpass=\'\"+password+\"\' where userphone=\'\"+phone+\"\'\"
5 try:
6 print(\"正在修改密码...\")
7 resetflag=cursor.execute(sql)
8 conn.commit()
9 close_conn(conn,cursor)
10 if(resetflag==1):
11 print(\"修改成功\")
12 return 1
13 else:
14 print(\"修改失败!\")
15 return 0
16 except:
17 print(\"系统错误...修改密码失败!\")
18 return 0

来源:https://www.cnblogs.com/rainbow-1/p/14800247.html
图文来源于网络,如有侵权请联系删除。

未经允许不得转载:百木园 » Python---flask框架实现修改密码功能

相关推荐

  • 暂无文章