Commit f53f9e57 authored by wanli's avatar wanli

update

parent 110522f3
...@@ -27,6 +27,9 @@ deploy/ ...@@ -27,6 +27,9 @@ deploy/
build/ build/
venv/ venv/
node_modules
frontend_backup
logs/*.log logs/*.log
logs/*.log.* logs/*.log.*
*.db *.db
...@@ -49,6 +52,9 @@ backend/backupData.json ...@@ -49,6 +52,9 @@ backend/backupData.json
config.ini config.ini
*.epk *.epk
tools/build_out/logs
tools/build_out/logs/*
release/ release/
release.* release.*
......
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-22 12:40:53
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \evm-store\backend\app\signal_manager.py
'''
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf_8 -*- # -*- coding: utf_8 -*-
...@@ -9,6 +17,7 @@ class SignalManager(object): ...@@ -9,6 +17,7 @@ class SignalManager(object):
actionBackupDatabase = PySignal() actionBackupDatabase = PySignal()
actionApplicationBuild = PySignal() actionApplicationBuild = PySignal()
actionGetConvertString = PySignal() actionGetConvertString = PySignal()
actionOpqcp = PySignal()
# 登录模块 # 登录模块
actionLogin = PySignal() actionLogin = PySignal()
......
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-06-22 13:38:34
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \evm-store\backend\controller\api_manager.py
'''
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf_8 -*- # -*- coding: utf_8 -*-
import os
import time import time
import json import json
import logging import logging
import traceback import traceback
import subprocess
import uuid import uuid
from datetime import datetime from datetime import datetime
from pony.orm import * from pony.orm import *
from model import fullStackDB from app.setting import config
from model.user import User from model.user import User
from utils import md5_salt from utils import md5_salt
from utils.ccode import convert_string from utils.ccode import convert_string
...@@ -49,4 +59,28 @@ class ApiManager(object): ...@@ -49,4 +59,28 @@ class ApiManager(object):
def get_escape_text(self, data): def get_escape_text(self, data):
return convert_string(data['string']) return convert_string(data['string'])
def opqcp(self, params):
target_file = os.path.normpath(os.sep.join([config.get("UPLOAD_PATH"), params.get("filename")]))
print("--------->", params, target_file)
print(os.stat(target_file))
# dtNowString = datetime.now().strftime("%Y%m%d%H%M%S%f")
# fn, ex = os.path.splitext(params.get("filename"))
output_path = os.path.dirname(target_file)
print("#######", output_path)
# command = ["./opqcp", target_file, output_path]
# ret = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, encoding="utf-8", timeout=5)
# if ret.returncode == 0:
# print("success:", ret)
# else:
# print("error:", ret)
ret = target_file
return True, ret
apiManager = ApiManager() apiManager = ApiManager()
...@@ -29,11 +29,15 @@ def stopApp(): ...@@ -29,11 +29,15 @@ def stopApp():
f.write(json.dumps(ret, indent=4)) f.write(json.dumps(ret, indent=4))
return ret return ret
def actionShowReport(): @api.route("/opqcp", methods=['POST'])
fpath = os.sep.join([os.getcwd(), "results", "TPC-E_dm.pdf"]) def action_opqcp():
with open(fpath, "rb") as f: params = request.json
ret = f.read()
return ret print(params)
signalManager.actionOpqcp.emit(params)
return response_result(ResponseCode.OK)
@api.route("/updatePassword", methods=['POST']) @api.route("/updatePassword", methods=['POST'])
@validate_schema(UpdatePasswordSchema) @validate_schema(UpdatePasswordSchema)
...@@ -49,11 +53,10 @@ def update_password(): ...@@ -49,11 +53,10 @@ def update_password():
def upload_file(): def upload_file():
try: try:
result = None result = None
message = None
binfile = request.files.get("binfile") binfile = request.files.get("binfile")
if not binfile: if not binfile:
return response_result(ResponseCode.REQUEST_ERROR, msg=message) return response_result(ResponseCode.REQUEST_ERROR, msg="upload field name error")
obj = dict() obj = dict()
obj['filename'] = binfile.filename obj['filename'] = binfile.filename
...@@ -83,10 +86,10 @@ def upload_file(): ...@@ -83,10 +86,10 @@ def upload_file():
"uuid": str(uuid.uuid4()), # 附件唯一编号 "uuid": str(uuid.uuid4()), # 附件唯一编号
"filename": obj['filename'], # 附件名称 "filename": obj['filename'], # 附件名称
"filesize": os.path.getsize(saveFile), # 附件大小 "filesize": os.path.getsize(saveFile), # 附件大小
"filepath": os.sep.join([config.get("UPLOAD_DIR"), relative_path, filename]).replace("\\", "/"), # 附件存储路径 "filepath": os.sep.join([relative_path, filename]).replace("\\", "/"), # 附件存储路径
}, "upload file [%s] successfully!" % obj['filename'] }
return response_result(ResponseCode.OK, data=result) return response_result(ResponseCode.OK, data=result, msg="upload file [%s] successfully!" % obj['filename'])
except Exception as e: except Exception as e:
traceback.print_exc() traceback.print_exc()
logger.error(str(e)) logger.error(str(e))
......
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