sbd-npm 1.5.1 → 1.5.2

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 +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/util.js CHANGED
@@ -191,8 +191,14 @@ const Util = {
191
191
  html.push('<div class="list-group">');
192
192
  if (j.data && j.data.length > 0) {
193
193
  j.data.forEach(function (item) {
194
+ let href = "";
194
195
  let upper_code = item.code.toUpperCase();
195
- html.push('<a target="_blank" rel="noopener noreferrer nofollow" class="list-group-item" href="/stock/', upper_code, '">', (item.name ? item.name : upper_code), '(', upper_code, ')</a>');
196
+ if (item.type && item.type === 1) {
197
+ href = Util.get_url("fund_public") + "?fund_code=" + upper_code;
198
+ } else {
199
+ href = "/stock/" + upper_code;
200
+ }
201
+ html.push('<a target="_blank" rel="noopener noreferrer nofollow" class="list-group-item" href="', href, '">', (item.name ? item.name : upper_code), '(', upper_code, ')</a>');
196
202
  });
197
203
  } else {
198
204
  html.push('<a href="#" class="list-group-item disabled">无数据</a>');