|
@@ -71,7 +71,7 @@ func init() {
|
|
|
var TimeSleepChan = make(chan bool, 1)
|
|
|
|
|
|
//加载文件
|
|
|
-func (s *Script) LoadScript(code, script_file string, newstate bool) string {
|
|
|
+func (s *Script) LoadScript(site *string, code, script_file string, newstate bool) string {
|
|
|
defer mu.Catch()
|
|
|
s.SCode = code
|
|
|
s.ScriptFile = script_file
|
|
@@ -549,6 +549,15 @@ func (s *Script) LoadScript(code, script_file string, newstate bool) string {
|
|
|
ftype = path.Ext(name)[1:]
|
|
|
}
|
|
|
}
|
|
|
+ //特殊处理中国招标投标公共服务平台异常附件过滤
|
|
|
+ if *site == "中国招标投标公共服务平台" {
|
|
|
+ if fid != "" && strings.Contains(fid, ErrFid) { //限制访问的附件
|
|
|
+ size, ftype, fid = "", "", "" //信息置空,AnalysisProjectInfo方法将判断数据下载失败重新下载
|
|
|
+ } else if bttype := qu.GetFileType(ret); bttype != "pdf" { //由字节流解析的附件类型不是pdf
|
|
|
+ logger.Info("Error File Type:", bttype, url)
|
|
|
+ size, ftype, fid = "", "", ""
|
|
|
+ }
|
|
|
+ }
|
|
|
S.Push(lua.LString(url))
|
|
|
S.Push(lua.LString(name))
|
|
|
S.Push(lua.LString(size))
|
|
@@ -841,6 +850,15 @@ func (s *Script) LoadScript(code, script_file string, newstate bool) string {
|
|
|
ftype = path.Ext(name)[1:]
|
|
|
}
|
|
|
}
|
|
|
+ //特殊处理中国招标投标公共服务平台异常附件过滤
|
|
|
+ if *site == "中国招标投标公共服务平台" {
|
|
|
+ if fid != "" && strings.Contains(fid, ErrFid) { //限制访问的附件
|
|
|
+ size, ftype, fid = "", "", "" //信息置空,AnalysisProjectInfo方法将判断数据下载失败重新下载
|
|
|
+ } else if bttype := qu.GetFileType(ret); bttype != "pdf" { //由字节流解析的附件类型不是pdf
|
|
|
+ logger.Info("Error File Type:", bttype, url)
|
|
|
+ size, ftype, fid = "", "", ""
|
|
|
+ }
|
|
|
+ }
|
|
|
S.Push(lua.LString(url))
|
|
|
S.Push(lua.LString(name))
|
|
|
S.Push(lua.LString(size))
|
|
@@ -901,10 +919,10 @@ func getChildrenLen(sq *gq.Selection) (ret int) {
|
|
|
}
|
|
|
|
|
|
//
|
|
|
-func (s *Script) Reload() {
|
|
|
- s.L.Close()
|
|
|
- s.LoadScript(s.SCode, s.ScriptFile, false)
|
|
|
-}
|
|
|
+//func (s *Script) Reload() {
|
|
|
+// s.L.Close()
|
|
|
+// s.LoadScript(s.SCode, s.ScriptFile, false)
|
|
|
+//}
|
|
|
|
|
|
//unicode转码
|
|
|
func transUnic(str string) string {
|