pull/267/head
midoks 3 years ago
parent 908a1f660a
commit cca3a5a899
  1. 6
      class/core/mw.py
  2. 6
      plugins/mysql/index.py

@ -167,6 +167,12 @@ def getOsID():
return data[0].strip()
def getFileSuffix(file):
tmp = file.split('.')
ext = tmp[len(tmp) - 1]
return ext
def isAppleSystem():
if getOs() == 'darwin':
return True

@ -857,8 +857,7 @@ def importDbExternal():
return mw.returnJson(False, '文件突然消失?')
exts = ['sql', 'gz', 'zip']
tmp = file.split('.')
ext = tmp[len(tmp) - 1]
ext = mw.getFileSuffix(file)
if ext not in exts:
return mw.returnJson(False, '导入数据库格式不对!')
@ -887,6 +886,9 @@ def importDbExternal():
mw.execShell(cmd)
import_sql = import_dir + tmpFile
if file.find(".sql") > -1 and file.find(".sql.gz") == -1:
import_sql = import_dir + tmpFile
if import_sql == "":
return mw.returnJson(False, '未找SQL文件')

Loading…
Cancel
Save