Browse Source

fix(encoding): due to windows compatibility, encoding change to utf-8

master
louisyoungx 3 years ago
parent
commit
64417eb07e
  1. 2
      Server/api.py
  2. 6
      Server/handler.py
  3. 2
      Static/js/index.js

2
Server/api.py

@ -17,7 +17,7 @@ glo = Global() @@ -17,7 +17,7 @@ glo = Global()
def log(request):
file_path = config.path() + config.settings("Logger", "FILE_PATH") + \
config.settings("Logger", "FILE_NAME")
file_page_file = open(file_path, 'r')
file_page_file = open(file_path, 'r', encoding="utf-8")
return str(file_page_file.read())

6
Server/handler.py

@ -95,19 +95,19 @@ class RequestHandler(BaseHTTPRequestHandler): @@ -95,19 +95,19 @@ class RequestHandler(BaseHTTPRequestHandler):
self.send_header("Content-Type", "application/javascript")
elif file_name[-4:] == ".png": # 二进制文件
self.send_header("Content-Type", "img/png")
file_page_file = open(file_path, 'rb', encoding="utf-8")
file_page_file = open(file_path, 'rb')
self.end_headers()
self.wfile.write(file_page_file.read())
return
elif file_name[-4:] == ".jpg": # 二进制文件
self.send_header("Content-Type", "img/jpg")
file_page_file = open(file_path, 'rb', encoding="utf-8")
file_page_file = open(file_path, 'rb')
self.end_headers()
self.wfile.write(file_page_file.read())
return
elif file_name[-4:] == ".ico": # 二进制文件
self.send_header("Content-Type", "img/ico")
file_page_file = open(file_path, 'rb', encoding="utf-8")
file_page_file = open(file_path, 'rb')
self.end_headers()
self.wfile.write(file_page_file.read())
return

2
Static/js/index.js

@ -191,7 +191,7 @@ new Vue({ @@ -191,7 +191,7 @@ new Vue({
});
// confirm,e.prototype.$prompt=ya.prompt,e.prototype.$notify=tl,e.prototype.$message=ou};
// confirm,e.prototype.$prompt=ya.prompt,e.prototype.$notify=tl,e.prototype.$message=ou};
//"undefined"!=typeof window&&window.Vue&&Ld(window.Vue);t.default={version:"2.15.0",
//locale:j.use,i18n:j.i18n,install:Ld,CollapseTransition:ii,Loading:_l,Pagination:pt,
//Dialog:gt,Autocomplete:kt,Dropdown:At,DropdownMenu:Bt,DropdownItem:Wt,Menu:ei,

Loading…
Cancel
Save