sbd-npm 1.4.79 → 1.4.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +9 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.79",
3
+ "version": "1.4.80",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/util.js CHANGED
@@ -22,6 +22,7 @@
22
22
  */
23
23
  const Util = {
24
24
 
25
+ version: "0",
25
26
  tips_token: "util-tips-div",
26
27
  load_token: "loading_div",
27
28
  interval_timer: null,
@@ -144,6 +145,12 @@ const Util = {
144
145
  document.title = page_title + " - " + d_title;
145
146
  }
146
147
  }
148
+
149
+ let document_html = document.documentElement.innerHTML;
150
+ let version_match = document_html.match(/\/sbd-npm@(\d+\.\d+\.\d+)\//);
151
+ if (version_match) {
152
+ Util.version = version_match[1];
153
+ }
147
154
  },
148
155
 
149
156
  /**
@@ -296,7 +303,8 @@ const Util = {
296
303
  url: url,
297
304
  headers: {
298
305
  'Cache-Control': 'no-cache',
299
- 'X-CSRF-TOKEN': Util.get_cookie('_csrf_token')
306
+ 'X-CSRF-TOKEN': Util.get_cookie('_csrf_token'),
307
+ 'X-Client-Version': Util.version
300
308
  },
301
309
  async: true,
302
310
  type: 'POST',