maxiaoshan 3 жил өмнө
parent
commit
69f58438ed

+ 12 - 3
src/front/front.go

@@ -553,10 +553,16 @@ func (f *Front) Importfile() {
 							o["urgency"] = 0
 						}
 						o["platform"] = cells[9].Value
+						weigh, _ := cells[10].Int()
+						estimate, _ := cells[11].Int()
+						qu.Debug(weigh, estimate)
+						o["estimate"] = estimate
+						o["weight"] = weigh
 						o["spidercompete"] = true
-						//						table := cells[6].Value
-						//						o["table"] = table
-						//						o["transfercode"] = qu.IntAll(Transfercode[table])
+						//table := cells[6].Value
+						//o["table"] = table
+						//o["transfercode"] = qu.IntAll(Transfercode[table])
+
 						query := bson.M{"code": cells[1].Value}
 						rs := *mgdb.FindOne("import", query)
 						if len(rs) > 0 {
@@ -674,6 +680,9 @@ func pf(o map[string]interface{}) (bool, string) {
 	param["spiderhistorymaxpage"] = 1
 	param["platform"] = o["platform"]
 	param["spidercompete"] = o["spidercompete"]
+	param["estimate"] = o["estimate"]
+	param["weight"] = o["weight"]
+
 	//qu.Debug("param---", param)
 	issave := spider.SaveSpider(o["code"].(string), param)
 	return issave, one["s_name"].(string)

+ 1 - 0
src/front/site.go

@@ -66,6 +66,7 @@ func (s *Site) SiteList() {
 			orderType = -1
 		}
 		sort = fmt.Sprintf(sort, orderName, orderType)
+		qu.Debug("query:", query, "sort:", sort)
 		sites, _ := util.MgoE.Find(sp.Config.SiteColl, query, sort, ``, false, start, limit)
 		count := util.MgoE.Count(sp.Config.SiteColl, query)
 		for k, s := range *sites {

+ 0 - 1
src/front/spider.go

@@ -596,7 +596,6 @@ func (f *Front) GetJson() {
 
 //整体测试
 func (f *Front) SpiderPass() {
-	qu.Debug("111111111111")
 	defer mu.Catch()
 	list := []map[string]interface{}{}
 	data := map[string]interface{}{}

+ 11 - 1
src/spider/script.go

@@ -113,7 +113,6 @@ func (s *Script) LoadScript(downloadnode, script string, isfile ...string) {
 		} else {
 			ret, retcookie = DownloadAdv(downloadnode, s.Downloader, url, method, util.GetTable(param), util.GetTable(head), mycookie, charset, false, ishttps, "", s.Timeout)
 		}
-
 		S.Push(lua.LString(ret))
 		scookie, _ := json.Marshal(retcookie)
 		S.Push(lua.LString(scookie))
@@ -418,6 +417,17 @@ func (s *Script) LoadScript(downloadnode, script string, isfile ...string) {
 		S.Push(lua.LString(base64Text))
 		return 1
 	}))
+	//base64解密
+	s.L.SetGlobal("decodeBase64", s.L.NewFunction(func(S *lua.LState) int {
+		text := S.ToString(-1)
+		result := ""
+		byteText, err := base64.StdEncoding.DecodeString(text)
+		if err == nil {
+			result = string(byteText)
+		}
+		S.Push(lua.LString(result))
+		return 1
+	}))
 	//aes ecb模式加密
 	s.L.SetGlobal("aesEncryptECB", s.L.NewFunction(func(S *lua.LState) int {
 		origData := S.ToString(-2)

+ 2 - 1
src/taskManager/taskManager.go

@@ -1139,7 +1139,8 @@ func (t *TaskM) SearchDataInfo() {
 	data, _ := u.MgoS.FindOne("spider_warn", map[string]interface{}{"href": href})
 	if data != nil && len(*data) > 0 {
 		info := (*data)["data"].(map[string]interface{})
-		str := "publishtime:" + fmt.Sprint(info["publishtime"]) + "\ntitle:" + qu.ObjToString((*data)["title"]) + ";\ndetail:" + qu.ObjToString(info["detail"])
+		publishtime := qu.Int64All(info["publishtime"])
+		str := "publishtime:" + fmt.Sprint(publishtime) + "\ntitle:" + qu.ObjToString((*data)["title"]) + ";\ndetail:" + qu.ObjToString(info["detail"])
 		t.ServeJson(str)
 	} else {
 		t.ServeJson("无信息")

+ 2 - 2
src/web/templates/sitelist.html

@@ -236,7 +236,7 @@ $(function(){
               "url": "/js/dataTables.chinese.lang"
           },
 		"columnDefs": [
-		     { "orderable": false, "targets": [0,1,2,3,4,5,6,7,8,9,10,11,13,14] }
+		     { "orderable": false, "targets": [0,1,3,4,5,6,7,8,9,10,11,13,14] }
 		],
 		"order": [[12,"desc"]],
         "lengthChange":false,
@@ -257,7 +257,7 @@ $(function(){
       { "data": "_id",render:function(val,a,row){
 				return row.num
 			}},
-			{ "data": "site"},
+	  { "data": "site"},
       { "data": "another_name"},
       { "data": "domain",render:function(val,a,row){
           return "<a href='http://"+val+"' target='_blank' style='color: #333'>"+val+"</a>"