File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -70,3 +70,4 @@ releaseInfo:
7070 releaseNotes : |
7171 修复会出现重复弹幕的问题
7272 修复历史记录无法显示封面的问题
73+ 适配弹弹play接口鉴权
Original file line number Diff line number Diff line change 1+ import { toast } from '@renderer/components/ui/toast'
12import { API_URL } from '@renderer/lib/env'
23import { ofetch } from 'ofetch'
34
45const apiFetch = ofetch . create ( {
56 baseURL : API_URL ,
67 timeout : 10000 ,
8+ onResponseError : ( error ) => {
9+ switch ( error . response . status ) {
10+ case 403 : {
11+ toast ( {
12+ title : '403 Forbidden' ,
13+ description : `接口请求被拒绝, 请联系开发者更新相关秘钥 - ${ error . response . url } ` ,
14+ } )
15+ break
16+ }
17+ default : {
18+ toast ( {
19+ title : '接口请求失败' ,
20+ description : error . request . toString ( ) ,
21+ } )
22+ }
23+ }
24+ } ,
25+ // onResponse: (response) => {
26+ // const responseData = response.response._data
27+ // if (responseData?.success === false) {
28+ // toast({
29+ // description: responseData?.errorMessage,
30+ // })
31+ // }
32+ // },
733} )
834
935export const Get = < T = object > ( url : string , params ?: object ) : Promise < T > =>
You can’t perform that action at this time.
0 commit comments