From 5588d0be860fae495beb3758d2ee50cf35ba778f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=9D=E5=B7=9D?= Date: Wed, 8 Dec 2021 12:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/text_recognition.py | 4 ++-- input/scripts.py | 8 ++++---- input/static/{json => template}/industry.json | 0 input/static/{json => template}/input.json | 0 input/static/{json => template}/rating.json | 0 user/scripts.py | 8 +++----- user/static/{json => template}/user.json | 0 7 files changed, 9 insertions(+), 11 deletions(-) rename input/static/{json => template}/industry.json (100%) rename input/static/{json => template}/input.json (100%) rename input/static/{json => template}/rating.json (100%) rename user/static/{json => template}/user.json (100%) diff --git a/common/text_recognition.py b/common/text_recognition.py index e97af84..28fdc04 100644 --- a/common/text_recognition.py +++ b/common/text_recognition.py @@ -42,7 +42,7 @@ def id_card_recognition(**kwargs): # 请求头 headers = { 'Authorization': 'APPCODE %s' % app_code, - 'Content-Type': 'application/json; charset=UTF-8' + 'Content-Type': 'application/template; charset=UTF-8' } # 请求体 @@ -83,7 +83,7 @@ def business_license_recognition(**kwargs): headers = { 'Authorization': 'APPCODE %s' % app_code, - 'Content-Type': 'application/json; charset=UTF-8' + 'Content-Type': 'application/template; charset=UTF-8' } body = { diff --git a/input/scripts.py b/input/scripts.py index 4fe8a0b..c4dfaff 100644 --- a/input/scripts.py +++ b/input/scripts.py @@ -118,7 +118,7 @@ def start_general_rating_script(cid): report_dates = make_3_report_dates() # 新填报记录 - new_input = read_json_file(file_path('/input/static/json/input.json')) + new_input = read_json_file(file_path('/input/static/template/input.template')) new_input['评价ID'] = new_rid new_input['企业ID'] = cid new_input['企业名称'] = find_user_info({"企业ID": cid})[0]['企业名称'] @@ -128,7 +128,7 @@ def start_general_rating_script(cid): new_input['财务填报'][sheets][i]['报告期'] = report_dates[i] # 生成新评价记录 - rating = read_json_file(file_path('/input/static/json/rating.json')) + rating = read_json_file(file_path('/input/static/template/rating.template')) rating['评价ID'] = new_rid rating['企业ID'] = cid rating['评价项目'] = "综合信用评价" @@ -166,7 +166,7 @@ def choose_industry_script(): Returns: res: desc """ - data = read_json_file(file_path('/input/static/json/industry.json')) + data = read_json_file(file_path('/input/static/template/industry.template')) return data @@ -178,5 +178,5 @@ def questionnaire_script(industry): Returns: data: 问卷内容 """ - data = read_json_file(file_path('/input/static/questionnaire/{}.json'.format(industry))) + data = read_json_file(file_path('/input/static/questionnaire/{}.template'.format(industry))) return data diff --git a/input/static/json/industry.json b/input/static/template/industry.json similarity index 100% rename from input/static/json/industry.json rename to input/static/template/industry.json diff --git a/input/static/json/input.json b/input/static/template/input.json similarity index 100% rename from input/static/json/input.json rename to input/static/template/input.json diff --git a/input/static/json/rating.json b/input/static/template/rating.json similarity index 100% rename from input/static/json/rating.json rename to input/static/template/rating.json diff --git a/user/scripts.py b/user/scripts.py index ae54179..fca6595 100644 --- a/user/scripts.py +++ b/user/scripts.py @@ -31,7 +31,7 @@ def send_email(email, code, v_type): "resetemail": "修改邮箱" } - headers = {"Content-Type": "application/json;charset=UTF-8"} + headers = {"Content-Type": "application/template;charset=UTF-8"} data = {"title": "【远东资信】{}".format(types[v_type]), "sender": 'fecribd@fecr.com.cn', "recipients": [email], @@ -49,7 +49,7 @@ def send_feedback_email(content): info: 发送信息 """ recipients = ["wangsichuan@fecr.com.cn"] - headers = {"Content-Type": "application/json;charset=UTF-8"} + headers = {"Content-Type": "application/template;charset=UTF-8"} data = {"title": '股交反馈邮件', "sender": 'fecribd@fecr.com.cn', "recipients": recipients, @@ -58,7 +58,6 @@ def send_feedback_email(content): return response.text -# 格式校验 def check_mail_fmt(email): """ 邮箱地址格式校验 @@ -93,7 +92,6 @@ def check_pwd_fmt(pwd): return result -# 用户验证相关 def check_registered(email): """ 检查邮箱是否被注册 @@ -167,7 +165,7 @@ def gen_new_user(email, pwd): Returns: user: 新用户信息 """ - user = read_json_file(file_path('/user/static/json/user.json')) + user = read_json_file(file_path('/user/static/template/user.template')) user['企业ID'] = gen_new_cid() user['邮箱'] = email user['头像fid'] = "61a15b33e55c00003e0048e4" diff --git a/user/static/json/user.json b/user/static/template/user.json similarity index 100% rename from user/static/json/user.json rename to user/static/template/user.json