提交 c58006787f87afa8350316c4c1102e4376e21a9a

作者 qianyingz
1 个父辈 e27582e3

登录页面样式调整

@@ -17,17 +17,42 @@ class Api(ApiTemplate): @@ -17,17 +17,42 @@ class Api(ApiTemplate):
17 try: 17 try:
18 user_guid = int(self.para.get("guid")) 18 user_guid = int(self.para.get("guid"))
19 obj_value = {"company": "company", "email": "email", 19 obj_value = {"company": "company", "email": "email",
20 - "position": "position", "phone": "phone", "password": "pwd"} 20 + "position": "position", "phone": "phone"}
21 21
22 userinfo = User.query.filter_by(id=user_guid) 22 userinfo = User.query.filter_by(id=user_guid)
23 if not userinfo.one_or_none(): 23 if not userinfo.one_or_none():
24 res["msg"] = "数据不存在" 24 res["msg"] = "数据不存在"
25 else: 25 else:
  26 + # 更新密码要求同时输入pwd/newPwd/reNewPwd
  27 + if self.para.__contains__("pwd") or self.para.__contains__("newPwd") or self.para.__contains__("reNewPwd"):
  28 + password = self.para.get("pwd")
  29 + new_password = self.para.get("newPwd")
  30 + re_new_password = self.para.get("reNewPwd")
  31 +
  32 + # validate pwd
  33 + if not password:
  34 + res["result"] = False
  35 + res["msg"] = "无原密码"
  36 + return res
  37 + if new_password != re_new_password:
  38 + res["result"] = False
  39 + res["msg"] = "两次输入密码不一致"
  40 + return res
  41 + if userinfo.first().password != password:
  42 + res["result"] = False
  43 + res["msg"] = "原密码输入错误"
  44 + return res
  45 +
  46 + # 更新密码
  47 + userinfo.update({"password": new_password})
  48 +
  49 + #更新用户基本信息
26 for key in obj_value: 50 for key in obj_value:
27 if self.para.__contains__(obj_value[key]): 51 if self.para.__contains__(obj_value[key]):
28 value = self.para.get(obj_value[key]) 52 value = self.para.get(obj_value[key])
29 - value = value if value is "None" or value is "none" else None 53 + value = "" if value == "None" or value == "none" else value
30 userinfo.update({key: value}) 54 userinfo.update({key: value})
  55 +
31 db.session.commit() 56 db.session.commit()
32 res["result"] = True 57 res["result"] = True
33 res["msg"] = "更新用户信息成功" 58 res["msg"] = "更新用户信息成功"
@@ -49,6 +74,16 @@ class Api(ApiTemplate): @@ -49,6 +74,16 @@ class Api(ApiTemplate):
49 "type": "string", 74 "type": "string",
50 "description": "密码", 75 "description": "密码",
51 "required": ""}, 76 "required": ""},
  77 + {"name": "newPwd",
  78 + "in": "formData",
  79 + "type": "string",
  80 + "description": "密码",
  81 + "required": ""},
  82 + {"name": "reNewPwd",
  83 + "in": "formData",
  84 + "type": "string",
  85 + "description": "密码",
  86 + "required": ""},
52 {"name": "company", 87 {"name": "company",
53 "in": "formData", 88 "in": "formData",
54 "type": "string", 89 "type": "string",
@@ -52,6 +52,16 @@ input { @@ -52,6 +52,16 @@ input {
52 margin-bottom: 54px; 52 margin-bottom: 54px;
53 } 53 }
54 54
  55 +.login-container-header-small.login-container-header {
  56 + font-size: 22px;
  57 + font-weight: 700;
  58 + text-align: left;
  59 + color: #545454;
  60 + letter-spacing: 1px;
  61 + text-align: center;
  62 + margin-bottom: 22px;
  63 +}
  64 +
55 .login-container-form { 65 .login-container-form {
56 margin-left: 401px; 66 margin-left: 401px;
57 height: 100%; 67 height: 100%;

224.1 KB | 宽: | 高:

234.1 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖
@@ -28,13 +28,15 @@ @@ -28,13 +28,15 @@
28 <div class="login-container"> 28 <div class="login-container">
29 <p class="login-container-logo"></p> 29 <p class="login-container-logo"></p>
30 <div class="login-container-form"> 30 <div class="login-container-form">
31 - <p class="login-container-header">广州城市信息研究所有限公司</p>  
32 31
33 {%if error%} 32 {%if error%}
  33 + <p class="login-container-header-small login-container-header">广州城市信息研究所有限公司</p>
34 <div class="form-tip"> 34 <div class="form-tip">
35 <span class="stop"></span> 35 <span class="stop"></span>
36 <p>{{error}}</p> 36 <p>{{error}}</p>
37 </div> 37 </div>
  38 + {% else %}
  39 + <p class="login-container-header">广州城市信息研究所有限公司</p>
38 {% endif %} 40 {% endif %}
39 41
40 <form action="" method="post"> 42 <form action="" method="post">
@@ -2,9 +2,8 @@ @@ -2,9 +2,8 @@
2 from flask import Flask 2 from flask import Flask
3 from app import create_app 3 from app import create_app
4 import os 4 import os
5 -os.environ 5 +os.environ['AUTHLIB_INSECURE_TRANSPORT'] = '1'
6 app: Flask = create_app() 6 app: Flask = create_app()
7 if __name__ == '__main__': 7 if __name__ == '__main__':
8 app.run(host="0.0.0.0", port="8840", threaded=True, debug=True) 8 app.run(host="0.0.0.0", port="8840", threaded=True, debug=True)
9 # app.run(host="0.0.0.0", port="8840", threaded=True) 9 # app.run(host="0.0.0.0", port="8840", threaded=True)
10 -  
注册登录 后发表评论