vannvan / yuque-tools

🧰 玩转语雀-朴实无华的语雀工具集合,语雀知识库+团队资源批量导出/备份工具(无需Token)|浏览器插件助手
https://npm.im/yuque-tools
MIT License
419 stars 40 forks source link

Error上报/GET请求报错 #25

Closed LianTianNo1 closed 1 year ago

LianTianNo1 commented 1 year ago

Node: 16.14.0 OS: win32 错误信息: AxiosError: Request failed with status code 401,https://(空间地址)/api/mine/user_books?user_type=Group Er

我的操作如下:

PS D:\Project\test-doc> ytool pull 开始登录语雀 开始获取知识库信息 ERR_BAD_REQUEST 👉提个BUG(cmd/ctrl+click) (​https://github.com/vannvan/yuque-tools/issues/new?title=Error%E4%B8%8A%E6%8A%A5%2FGET%E8%AF%B7%E6%B1%82%E6%8A%A5%E9%94%99&body=Node%3A+16.14.0+OS%3A+win32%0A%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF%3A+AxiosError%3A+Request+failed+with+status+code+401%2Chttps%3A%2F%2Faiyongbao.yuque.com%2Fapi%2Fmine%2Fuser_books%3Fuser_type%3DGroup%0AEr ror%0A++++at+Object.error+%28file%3A%2F%2F%2FC%3A%2FUsers%2FAIYONG%2FAppData%2FRoaming%2Fnvm%2Fv16.14.0%2Fnode_modules%2Fyuque-tools%2Fdist%2Flib%2Fdev%2Flog.js%3A11%3A27%29%0A++++at+file%3A%2F%2F%2FC%3A%2FUsers%2FAIYONG%2FAppData%2FRoaming%2Fnvm%2Fv16.14.0%2Fnode_modules%2Fyuque-tools%2Fdist%2Flib%2Frequest.js%3A32%3A17%0A++++at+processTicksAndRejections+%28node%3Ainternal%2Fprocess%2Ftask_queues%3A96%3A5%29%0A%0A%E4%BB%A5%E4%B8%8A%E4%BF%A1%E6%81%AF%E5%8F%AF%E5%88%A0%E9%99%A4%E8%B7%AF%E5%BE%84%E7%AD%89%E9%9A%90%E7%A7%81%E4%BF%A1%E6%81%AF%EF%BC%8C%E4%BD%86%E9%9C%80%E8%A6%81%E4%BF%9D%E7%95%99%E4%B9%8B%E5%90%8E%E7%9A%84%E8%A1%8C%E6%95%B0%E5%93%A6%7E​) node:internal/process/promises:265 triggerUncaughtException(err, true / fromPromise /); ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "ERR_BAD_REQUEST".] { code: 'ERR_UNHANDLED_REJECTION' }

vannvan commented 1 year ago

Node: 16.14.0 OS: win32 错误信息: AxiosError: Request failed with status code 401,https://(空间地址)/api/mine/user_books?user_type=Group Er

我的操作如下:

PS D:\Project\test-doc> ytool pull 开始登录语雀 开始获取知识库信息 ERR_BAD_REQUEST 👉提个BUG(cmd/ctrl+click) (​https://github.com/vannvan/yuque-tools/issues/new?title=Error%E4%B8%8A%E6%8A%A5%2FGET%E8%AF%B7%E6%B1%82%E6%8A%A5%E9%94%99&body=Node%3A+16.14.0+OS%3A+win32%0A%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF%3A+AxiosError%3A+Request+failed+with+status+code+401%2Chttps%3A%2F%2Faiyongbao.yuque.com%2Fapi%2Fmine%2Fuser_books%3Fuser_type%3DGroup%0AEr ror%0A++++at+Object.error+%28file%3A%2F%2F%2FC%3A%2FUsers%2FAIYONG%2FAppData%2FRoaming%2Fnvm%2Fv16.14.0%2Fnode_modules%2Fyuque-tools%2Fdist%2Flib%2Fdev%2Flog.js%3A11%3A27%29%0A++++at+file%3A%2F%2F%2FC%3A%2FUsers%2FAIYONG%2FAppData%2FRoaming%2Fnvm%2Fv16.14.0%2Fnode_modules%2Fyuque-tools%2Fdist%2Flib%2Frequest.js%3A32%3A17%0A++++at+processTicksAndRejections+%28node%3Ainternal%2Fprocess%2Ftask_queues%3A96%3A5%29%0A%0A%E4%BB%A5%E4%B8%8A%E4%BF%A1%E6%81%AF%E5%8F%AF%E5%88%A0%E9%99%A4%E8%B7%AF%E5%BE%84%E7%AD%89%E9%9A%90%E7%A7%81%E4%BF%A1%E6%81%AF%EF%BC%8C%E4%BD%86%E9%9C%80%E8%A6%81%E4%BF%9D%E7%95%99%E4%B9%8B%E5%90%8E%E7%9A%84%E8%A1%8C%E6%95%B0%E5%93%A6%7E​) node:internal/process/promises:265 triggerUncaughtException(err, true / fromPromise /); ^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "ERR_BAD_REQUEST".] { code: 'ERR_UNHANDLED_REJECTION' }

检查一下空间域名是否正确,应该形如 https://xxx.yuque.com 后面没有反斜杠

LianTianNo1 commented 1 year ago

空间域名是正确的,后面把配置文件换了一个文件夹,再使用 ytool pull 就成功了,可能是之前那个文件夹生成了一些文件影响到了