Browse Source

修改报错

gushoubang 10 months ago
parent
commit
beb5113350
1 changed files with 8 additions and 5 deletions
  1. 8 5
      app.py

+ 8 - 5
app.py

@@ -24,8 +24,8 @@ conn = psycopg2.connect(
     dbname="real3d",
     dbname="real3d",
     user="postgres",
     user="postgres",
     password="postgis",
     password="postgis",
-    host="192.168.100.30",
-    # host="192.168.60.2",
+    # host="192.168.100.30",
+    host="192.168.60.2",
     port="5432"
     port="5432"
 )
 )
 
 
@@ -68,6 +68,7 @@ def upload_file():
     file_path = os.path.join(UPLOAD_FOLDER, filename)
     file_path = os.path.join(UPLOAD_FOLDER, filename)
     file.save(file_path)
     file.save(file_path)
     msg = vocal_text(file_path)
     msg = vocal_text(file_path)
+    msg=msg.replace("爆破", "抱坡")
 
 
     return jsonify({"msg": "上传成功",
     return jsonify({"msg": "上传成功",
                     "code": 200,
                     "code": 200,
@@ -256,9 +257,11 @@ def jsonResToDict(json_res):
         conditionInfo = factorInfo["condition_info"]
         conditionInfo = factorInfo["condition_info"]
         conditionObj = json.loads(conditionInfo)
         conditionObj = json.loads(conditionInfo)
 
 
-        defaultValue = str(factor["value"])
-        if defaultValue == '':
-            defaultValue = '0'
+        defaultValue ='0'
+        if "value" in factor:
+            defaultValue=str(factor["value"])
+        # if defaultValue == '':
+        #     defaultValue = '0'
 
 
         factor_info = {
         factor_info = {
             "id": factorId,
             "id": factorId,