PageSourceSearch

https://gushu.net.cn/public/static/js/behaviorrecord.js

js gushu.net.cn collected 2026-10-04 01:37:35 UTC 2,412 bytes, 84 lines download raw bytes

1console.log(navigator.userAgent);
2moment.tz.setDefault("Asia/Shanghai"); 
3
4// 页面路径
5var this_url = location.href;
6
7var save_add_url = '/index.php/p/behaviorrecord-logs-add.html';
8
9var title = document.title;
10
11// 停留时间,按秒计算
12var second = 1;
13var seconds = 0;
14setInterval(() => {
15    var num = 0;
16    if(localStorage.getItem("tingliu_time"+this_url)){
17        num = parseInt(localStorage.getItem("tingliu_time"+this_url));
18    } else{
19        localStorage.setItem("tingliu_time"+this_url, second);  // 保存页面停留时间,防止刷新
20    }
21    second++;
22    seconds = second + num;
23    // console.log(second,num,seconds);
24}, 1000);
25// 进入页面时间戳
26var now_date_in = Math.round(moment().format('X'));
27if(localStorage.getItem("now_date"+this_url)){
28    now_date_in = localStorage.getItem("now_date"+this_url);
29} else{
30    localStorage.clear();
31    localStorage.setItem("now_date"+this_url, now_date_in);
32}
33// console.log(localStorage.getItem("now_date"+this_url),now_date_in);
34// console.log(window.__wxjs_environment === 'miniprogram' , location.search.indexOf("miniprogram") != -1);  // 检查是否为小程序或者H5
35
36// var get_timgliu_time = localStorage.getItem("tingliu_time"+this_url);
37
38// var now_url = $.cookie('now_url', this_url ,{expires:1,path:'/'});
39// console.log(now_url);
40
41$(function(){
42    var submit_arr = {
43        'now_date':now_date_in,
44        'url':this_url,
45        'timelength':seconds,
46        'title':title
47    }
48    // if($.cookie('now_url') == null || $.cookie('now_url') == undefined){
49        save_add(submit_arr);
50    // }
51    $.cookie('now_url', this_url);
52})
53
54/**
55 * 离开当前页面时,停留时间等
56 */
57window.onbeforeunload = function(){
58    var submit_arr = {
59        'now_date':now_date_in,
60        'url':this_url,
61        'timelength':seconds,
62        'title':title,
63        'exitpage':1
64    }
65    localStorage.setItem("tingliu_time"+this_url, seconds);
66    save_add(submit_arr);
67    // localStorage.clear();
68    // console.log(submit_arr,54);
69};
70/**
71 * @param array datas 数组对象
72 */
73function save_add(datas={}){
74    $.ajax({
75        type: 'post',
76        url: save_add_url,
77        data: datas,
78        dataType: 'json',
79        success: function(data){
80            console.log(data);
81        },
82        error: function(res){}
83    })
84}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.