-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat: add axios request test #14
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/bangumi-fe/frontend/5NxBnxTzXcULS2e2kTU5oHeBS3cb |
打包之后浏览器会报 |
Codecov Report
@@ Coverage Diff @@
## master #14 +/- ##
============================================
- Coverage 100.00% 87.06% -12.94%
============================================
Files 3 5 +2
Lines 58 116 +58
Branches 3 7 +4
============================================
+ Hits 58 101 +43
- Misses 0 14 +14
- Partials 0 1 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
谢谢贡献
|
||
// 异常拦截处理器 | ||
const errorHandler = (error:any) => { | ||
console.log(error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(error) |
console.log
好像不太必要
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请求异常先log一下,以后再补异常处理
bgm38,如果可以的话麻烦补个单测吗?不行的话我来补也可以,当作后来 PR 的一个例子。 |
没写过单测,不知道怎么写b38 |
const api = { | ||
getCharacterDetail: '/v0/characters/' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
个人觉得可以不用这个 api
,直接写到方法上就好。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有的时候可以复用,路径多了也方便管理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
又发邮件警报了 我删掉了🤣
Co-authored-by: Qingyu Deng <[email protected]>
Co-authored-by: Qingyu Deng <[email protected]>
Merged, thanks |
Deploying with Cloudflare Pages
|
加了个axios请求库,写法很土,环境变量是放在对应workplace下面吗
两个问题
我不知道怎么改