PageSourceSearch

https://cyqh.com.cn/static/pages/script/appJs/index.js

js cyqh.com.cn collected 2026-10-04 15:06:01 UTC 8,250 bytes, 228 lines download raw bytes

1let _Bridge = {}
2!(function(win, doc, axios, $) {
3  let userAgent = navigator.userAgent;
4  function __Bridge() {
5    this.axiosConfig = {
6      url: '',
7      method: 'post', // 默认为post请求
8      // baseURL:"https://kgu.cn",
9      baseURL:"/api",
10      // baseURL:"http://server.kgu.cn:10120",
11      // baseURL:"http://192.168.31.139:9012",
12      headers: {
13        'Content-Type': 'application/json;charset=UTF-8',
14        'lang':lang,
15        'siteId':siteId
16      },
17    },
18        this.myRequestCreate = axios.create({...this.axiosConfig}),
19        this.BridgeHttp = function () {},
20        this.requestAxios = function (reslove, reject, method, url, data) {
21          this.myRequestCreate({
22            url,
23            method,
24            ...data
25          }).then(res => {
26            if(res.code == 403) {
27              // localStorage.removeItem("token");
28              Cookies.remove("token");
29              Cookies.remove("KGU-Authorization");
30              layer.msg(res.message);
31              // window.location.href="/"
32              reject(res.message);
33            } else if(res.code == 500) {
34
35            }
36            reslove(res)
37          }).catch(error => {
38            reject(error)
39          })
40        }
41  }
42
43  __Bridge.prototype.interceptors = function() {
44    this.myRequestCreate.interceptors.request.use(function (request) {
45      const token = Cookies.get("KGU-Authorization");
46
47      request.headers['KGU-Authorization'] = token;
48      return request;
49    }, function (error) {
50      return Promise.reject(error)
51    })
52    this.myRequestCreate.interceptors.response.use(function (response) {
53      return response.data;
54    }, function (error) {
55      return Promise.reject(error)
56    })
57  }
58  __Bridge.prototype.get = function (url, params) {
59    return new Promise((reslove, reject) => {
60      this.requestAxios(reslove, reject, "GET", url, { params })
61    })
62  }
63  __Bridge.prototype.post = function (url, data) {
64    return new Promise((reslove, reject) => {
65      this.requestAxios(reslove, reject, "POST", url, { data })
66    })
67  }
68  __Bridge.prototype.delete = function (url, data) {
69    return new Promise((reslove, reject) => {
70      this.requestAxios(reslove, reject, "DELETE", url, { data })
71    })
72  }
73  __Bridge.prototype.put = function (url, data) {
74    return new Promise((resolve, reject) => {
75      this.requestAxios(resolve, reject, "PUT", url, { data });
76    });
77  };
78  /**
79   * 获取到UTC时间,将该时间转换为当前电脑指定时区对应的时间(包括夏令时将自动转换)
80   * */
81  __Bridge.prototype.convertTime = function (time) {
82    if(!time) return time;
83    let londonDate = new Date(time);
84    let browserOffset = new Date().getTimezoneOffset() * 60 * 1000; // 获取浏览器的时区偏移量
85    return new Date(londonDate.getTime() - browserOffset).toLocaleString();
86  }
87  __Bridge.prototype.debounce = function(func, delay, immediate) {
88    let timer = null;
89    return function (...args) {
90      const context = this;
91      if (immediate && !timer) {
92        func.apply(context, args);
93      }
94      clearTimeout(timer);
95      timer = setTimeout(() => {
96        if (!immediate) {
97          func.apply(context, args);
98        }
99        timer = null;
100      }, delay);
101    };
102  }
103
104  __Bridge.prototype.isEmail = function(value) {
105    let reg_email = /^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
106    return reg_email.test(value);
107  }
108  __Bridge.prototype.isLoading = function(flag) {
109    const loadDom = `<div id="onLoading" class="request-loading-view show">
110                       <div class="loading"></div>
111                     </div>`
112
113    flag ? $("body").append(loadDom) : $('body > #onLoading').remove();
114  }
115  __Bridge.prototype.alert = function(flag, value, fun) {
116    let alertDom
117    if(flag && flag == 'modal') {
118      alertDom = `<div id="shop_dlg_uuid" class="shop_dialog_uuid show">
119                      <div class="shop_container">
120<!--                        <div class="hd_con">-->
121<!--                          <p>Confirmation</p>-->
122<!--                        </div>-->
123                        <div class="sp_con">
124                          <p>${value}</p>
125                        </div>
126                      </div>
127                    </div>`
128    }else {
129      alertDom = `<div id="shop_dlg_uuid" class="shop_dialog_uuid show">
130                      <div class="shop_container">
131                        <div class="hd_con">
132                          <p>Confirmation</p>
133                          <div class="close"></div>
134                        </div>
135                        <div class="sp_con">
136                          <p>Delete this product?</p>
137<!--                          <div class="shop_bt">-->
138<!--                            <p class="btn dia_bt">Cancel</p>-->
139<!--                            <p class="btn dia_bt on">Delete</p>-->
140<!--                          </div>-->
141                        </div>
142                      </div>
143                    </div>`
144
145    }
146    $("body").append(alertDom);
147    setTimeout(() => {
148      $('body > #shop_dlg_uuid').remove();
149      fun&&fun();
150    }, 1000)
151  }
152
153  __Bridge.prototype.modelAlert = function( value, fun) {
154    let alertDom = `<div id="shop_dlg_uuid" class="shop_dialog_uuid show">
155                      <div class="shop_container">
156                        <div class="hd_con">
157                          <p>Confirmation</p>
158                          <div class="close modelColse"></div>
159                        </div>
160                        <div class="sp_con sp_con2">
161                          <p>${value}</p>
162<!--                          <div class="shop_bt">-->
163<!--                            <p class="btn dia_bt">Cancel</p>-->
164<!--                            <p class="btn dia_bt on">Delete</p>-->
165<!--                          </div>-->
166                        </div>
167                      </div>
168                    </div>`
169    $("body").append(alertDom);
170    $(".modelColse").click(function() {
171      $('body > #shop_dlg_uuid').remove();
172    })
173  }
174  __Bridge.prototype.imgAlert = function( value, fun) {
175    let alertDom = `<div id="shop_dlg_uuid" class="shop_dialog_uuid show xc">
176                      <div class="shop_container">
177<!--                        <div class="hd_con">-->
178<!--                          <p>Confirmation</p>-->
179                          <div class="close modelColse"></div>
180<!--                        </div>-->
181                        <div class="sp_con sp_con2">
182                          <p>${value}</p>
183<!--                          <div class="shop_bt">-->
184<!--                            <p class="btn dia_bt">Cancel</p>-->
185<!--                            <p class="btn dia_bt on">Delete</p>-->
186<!--                          </div>-->
187                        </div>
188                      </div>
189                    </div>`
190    $("body").append(alertDom);
191    $(".modelColse").click(function() {
192      $('body > #shop_dlg_uuid').remove();
193    })
194  }
195
196  /**
197   * 提交确认框
198   * @param value 需要显示的内容
199   * @param cancel 取消的回调函数
200   * @param confirm 确认的回调函数,接收一个函数,调用可关闭弹窗
201   */
202  __Bridge.prototype.submitConfirmationBox = function ({value, cancel,confirm}) {
203    let alertDom = `<div id="submit-confirmation-box" class="submit-confirmation-box show xc">
204                      <div class="shop_container">
205                          <div class="sp_con sp_con2">
206                              <p>${value}</p>
207                              <div class="shop_bt">
208                                <p class="btn dia_bt modelColse">取消</p>
209                                <p class="btn dia_bt on">确认</p>
210                              </div>
211                          </div>
212                      </div>
213                    </div>`
214    $("body").append(alertDom);
215    $(".modelColse").click(function () {
216      $('body > #submit-confirmation-box').remove();
217      !!cancel && cancel()
218    })
219    $("#submit-confirmation-box").find(".on").click(function (){
220      confirm(function (){
221        $('body > #submit-confirmation-box').remove();
222      })
223    })
224  }
225
226  _Bridge = new __Bridge()
227  _Bridge.interceptors()
228})(window, document, axios, $);

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.