PageSourceSearch

https://lingyuzhao.top/js/loggerMark.js

js lingyuzhao.top collected 2026-10-06 13:16:03 UTC 1,971 bytes, 65 lines download raw bytes

1/* 日志记录脚本 */
2
3/**
4 * 插入一行日志
5 * @param type 日志记录类型
6 * @param desc 日志记录描述
7 */
8function markLoggerLy(type, desc) {
9    if (desc.length >= 100) {
10        console.error("日志记录错误,日志描述信息太长!", desc)
11        return;
12    }
13    axios.defaults.withCredentials = true;
14    if (my && my.ip) {
15        getIPLocationAndCache(my.ip).then(
16            (res) => {
17                axios(
18                    {
19                        url: logger_host_href() + '/' + WEB_CONF['CONTROLLER_WEB_LOGGER'] + WEB_CONF['CONTROLLER_LOGGER'],
20                        method: 'post',
21                        params: {
22                            operator: my.name,
23                            address: res.address,
24                            type: type,
25                            desc: desc
26                        }
27                    }
28                )
29            }
30        )
31    } else {
32        getMyIPAddress().then(r => {
33            getIPLocationAndCache(r.ip).then(
34                (res) => {
35                    axios(
36                        {
37                            url: logger_host_href() + '/' + WEB_CONF['CONTROLLER_WEB_LOGGER'] + WEB_CONF['CONTROLLER_LOGGER'],
38                            method: 'post',
39                            params: {
40                                operator: "无认证者_" + r.ip,
41                                address: res.address,
42                                type: type,
43                                desc: desc
44                            }
45                        }
46                    )
47                }
48            )
49        })
50    }
51}
52
53/**
54 * 用户访问日志记录
55 */
56function visMark(desc = my.lon + ' ' + my.lat + "|访问:" + getNOW_PAGE()) {
57    markLoggerLy("visit", desc)
58}
59
60/**
61 * 用户访问日志记录
62 */
63function errorMarkLogger(desc) {
64    markLoggerLy("error", desc)
65}

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.