PageSourceSearch

https://lingyuzhao.top/js/Global_Vars.js

js lingyuzhao.top collected 2026-10-06 13:15:39 UTC 982 bytes, 46 lines download raw bytes

1/**
2 * 共享变量类
3 */
4class Global_Vars {
5    // 全局变量
6    static global_vars = {}
7
8    // 全局变量可用状态标识
9    static status = false;
10
11    static {
12        Global_Vars.push("LY_Utils.checkBackUrlIsCOOKIE_DOMAIN()", LY_Utils.checkBackUrlIsCOOKIE_DOMAIN());
13    }
14
15    static push(key, value) {
16        this.global_vars[key] = value
17    }
18
19    /**
20     * 启用全局变量的支持
21     */
22    static enable() {
23        this.status = true
24    }
25
26    /**
27     *
28     * @param key
29     * @return {*|undefined} 如果可用且有变量则返回数据 反之返回
30     */
31    static getNoCheckStatus(key) {
32        return this.global_vars[key];
33    }
34
35    /**
36     *
37     * @param key
38     * @return {*|undefined} 如果可用且有变量则返回数据 反之返回
39     */
40    static get(key) {
41        if (this.status) {
42            return this.getNoCheckStatus(key);
43        }
44        return undefined;
45    }
46}

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.