Commit 1337cddb by dong

fix20221121

parent 83633cb0
......@@ -343,10 +343,10 @@ def upload_daily_picture(file_type, file_name, file):
file_name = file_name[0] + time_stamp + '.' + file_name[1]
file_url = ''
if file_type == 1:
bucket.put_object('/晋城招商图谱平台/四库管理文件/文件/' + file_name, file)
bucket.put_object('晋城招商图谱平台/四库管理文件/文件/' + file_name, file)
file_url = "https://{}.{}/{}".format(bucket_name, endpoint, '/晋城招商图谱平台/四库管理文件/文件/' + file_name)
if file_type == 2:
bucket.put_object('/晋城招商图谱平台/四库管理文件/图片/' + file_name, file)
bucket.put_object('晋城招商图谱平台/四库管理文件/图片/' + file_name, file)
file_url = "https://{}.{}/{}".format(bucket_name, endpoint, '/晋城招商图谱平台/四库管理文件/图片/' + file_name)
time.sleep(1)
return file_url
......@@ -355,13 +355,6 @@ def upload_daily_picture(file_type, file_name, file):
return jsonify(code=RET.THIRDERR, msg='第三方系统(阿里云oss存储)出错!')
@api_manage.route("/UploadPic", methods=["POST"])
def upload_pic():
file = request.files['file']
file_name = request.form['file_name']
upload_daily_picture(2, file_name, file)
# 编辑页文件图片删除接口
def file_delete(file_del_list, img_del_list, project_id, flag):
if file_del_list:
......@@ -1567,13 +1560,6 @@ def edit_project():
except Exception as e:
current_app.logger.error(e)
return jsonify(code=RET.DBERR, msg="文件/图片上传出错,编辑失败!")
# msg1 = ''
# msg2 = ''
# if flag1 == 1:
# msg1 = '文件上传成功。'
# if flag2 == 1:
# msg2 = '图片上传成功。'
# return jsonify(code=RET.OK, msg="编辑成功!" + msg1 + msg2)
db.session.commit()
# 记录项目动态
time1 = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment