ソースを参照

爬虫导入修改

mxs 1 年間 前
コミット
a75a6a76b9
3 ファイル変更6 行追加6 行削除
  1. 2 2
      src/front/front.go
  2. 3 3
      src/front/spider.go
  3. 1 1
      src/web/templates/task.html

+ 2 - 2
src/front/front.go

@@ -314,8 +314,8 @@ func (f *Front) ImportLua() {
 							continue
 						}
 						o := make(map[string]interface{})
-						o["name"] = cells[0].Value
-						o["code"] = code
+						o["name"] = u.SymbolReg.ReplaceAllString(cells[0].Value, "")
+						o["code"] = u.SymbolReg.ReplaceAllString(code, "")
 						o["channel"] = cells[2].Value
 						spiderremark := cells[3].Value
 						if spiderremark == "" {

+ 3 - 3
src/front/spider.go

@@ -734,13 +734,13 @@ func LuaTextCheck(infoformat int, param map[string]interface{}, param_list_chrom
 			site := qu.ObjToString(param[1])
 			channel := qu.ObjToString(param[2])
 			if !strings.Contains(list, fmt.Sprintf(u.CheckText_Code, spidercode)) {
-				errmsg += `item["spidercode"]的值与模板不一致;`
+				errmsg += `爬虫代码的值与模板不一致;`
 			}
 			if !strings.Contains(list, fmt.Sprintf(u.CheckText_Site, site)) {
-				errmsg += `item["site"]的值与模板不一致;`
+				errmsg += `站点的值与模板不一致;`
 			}
 			if !strings.Contains(list, fmt.Sprintf(u.CheckText_Channel, channel)) {
-				warnmsg += `item["channel"]的值与模板不一致;`
+				warnmsg += `栏目的值与模板不一致;`
 			}
 		}
 

+ 1 - 1
src/web/templates/task.html

@@ -150,7 +150,7 @@
 			"searching": true,
 			"ordering": true,
 			"info": true,
-			"autoWidth": true,
+			"autoWidth": false,
 			"columns": [
 				{"data": "href"},
 				{"data": "_id",render:function(val,a,row){