Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fail: Stock error #16

Closed
yiliang114 opened this issue Aug 10, 2020 · 15 comments
Closed

fail: Stock error #16

yiliang114 opened this issue Aug 10, 2020 · 15 comments
Labels
need repreduce question Further information is requested 使用

Comments

@yiliang114
Copy link
Contributor

image
问下这是啥原因 ?

@giscafer
Copy link
Member

@yiliang114 你用默认的股票代码是不是没有问题,然后自己改了股票代码才出现了?

应该是股票代码引起了接口请求报错。可以进入扩展程序设置里边看股票代码是否存在异常值。

@yiliang114
Copy link
Contributor Author

@giscafer 这个报错是光指股票代码数组有问题呢 还是说基金的代码数组中有问题的也算的? 我在设置里面好像只看到(设置了) leek-fund.funds 但是没有 leek-fund.stocks 这个值。 另外这里如果是自己改了的话,"可以进入扩展程序设置里边看股票代码是否存在异常值。" 这里该如何排查呢? 之前因为关注的基金比较多,感觉一个一个输入略低效,看这个插件是直接读取的配置项,就直接在配置里面加了~

@giscafer
Copy link
Member

@yiliang114 用户没有设置的时候,插件会默认用文档中的那些(但是没有 leek-fund.stocks 这个值,应该是你没有设置过股票,是正常的)。用户设置了就用用户的设置值。

请问你是第一次安装此插件吗?还是之前安装过,最近更新而已。目前还无法定位你的问题,可以进入设置里边复制出你所有带 leek-fund.xxx 的配置项出来看看

@yiliang114
Copy link
Contributor Author

上周安装的,这几天好像你有几次更新,我就点了更新了。

  "leek-fund.funds": [
    "001632",
    "420009",
    "320007",
    "003096",
    "001102",
    "003885",
    "001071",
    "005963",
    "005223",
    "002316",
    "161726",
    "161028",
    "161725",
    "001838",
    "004224",
    "005609",
    "002190",
    "004997",
    "161122",
    "110011",
    "160630",
    "160632",
    "161903",
    "260108",
    "000940",
    "008062",
    "008061",
    "160222",
    "005312",
    "501009",
    "501005",
    "007523",
    "090020",
    "000717",
    "004070",
    "002084",
    "005825",
    "003304",
    "002707",
    "004702",
    "519674",
    "002560",
    "005763",
    "003095",
    "004683",
    "006257",
    "001618",
    "001595",
    "001630",
    "162703",
    "005911",
    "000529",
    "004851",
    "003230",
    "003642"
  ],

@giscafer
Copy link
Member

@yiliang114 哇,好多基金啊。。。

你的这个错误fail: Stock error 是股票的接口报错,和基金分开的。你尝试一下以下操作帮忙重现一下问题:

(1)进入插件设置配置,替换股票设置为以下

  "leek-fund.stocks": [
    "sh000001",
    "sh000300"
  ]

上边是上证指数和沪深300的股票代码

(2)保存后,重启VSCode

(3)点击左侧菜单看看有没有股票数据

@yiliang114
Copy link
Contributor Author

yiliang114 commented Aug 10, 2020

添加了配置之后,重启,股票部分没有数据;在左侧栏股票上方点击添加按钮之后,加入股票,显示添加成功,但是也没有出现股票的数据。

image
image

@giscafer
Copy link
Member

giscafer commented Aug 10, 2020

@yiliang114 刚升级了一次,你安装新版的,看看,错误提示有什么信息没,代码里边吧错误提示打印出来了(右下角的错误弹窗)。 b529990#diff-22ccf3ebb0cb6b300ee90a38b88edff8R273

最新版本 v1.1.4

第二个查看日记的方式:

windows 系统的话 Windows + p 输入 >,找 Toggle Developer Tools 打开,手动刷新股票(点击刷新按钮),看看输出日记

Mac 电脑就 Command + p 输入 >,找 Toggle Developer Tools 打开

@yiliang114
Copy link
Contributor Author

image

@giscafer ~

@giscafer
Copy link
Member

giscafer commented Aug 10, 2020

手动安装插件 leek-fund-1.1.5.vsix.zip

再看一次打印日记。这里我把请求连接和参数打印出来了。

上边的错误定位就是请求股票接口报了501的错误,目前需要再定位一下是什么参数报的错误。

手动安装步骤:解压后选择文件
image

@yiliang114

@yiliang114
Copy link
Contributor Author

image

看这些报错,怎么看着都像是 vscode 提供的 api 给的...

@giscafer
Copy link
Member

giscafer commented Aug 10, 2020

https://hq.sinajs.cn/list=sh000001,sh000300

你确定你浏览器能访问这个接口吗(复制浏览器打开)。图片里这个链接请求参数竟然报错了,我这里打开正常。

方便的话加微信群交流 #19

@yiliang114
Copy link
Contributor Author

可以访问哒 ~ 我加群了~

@giscafer
Copy link
Member

https axios 请求走了系统代理导致了 501 错误。系统设置了代理建议将域名请求地址加入白名单。

@giscafer giscafer added the question Further information is requested label Aug 11, 2020
@laggage
Copy link

laggage commented Jun 10, 2021

windows上没有用管理员启动vscode也会遇到这个错误...

@laggage
Copy link

laggage commented Jun 10, 2021

通过code命令启动时会提示这个错误, 然后我从快捷方式启动的话居然又好了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need repreduce question Further information is requested 使用
Projects
None yet
Development

No branches or pull requests

3 participants