File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import type { AxiosRequestConfig, AxiosResponse } from 'axios'
5
5
import { Message , Modal } from '@arco-design/web-vue'
6
6
import { RecordsType } from '@/store/modules/code-run/types'
7
7
8
- const { CancelToken } = axios
9
-
10
8
export interface OutputType {
11
9
affectedrows : number
12
10
records : RecordsType
@@ -122,11 +120,21 @@ axios.interceptors.response.use(
122
120
} ,
123
121
124
122
( error ) => {
123
+ const isV1 = ! ! error . config . url ?. startsWith ( `/v1` )
124
+
125
125
if ( error . response . status === 401 ) {
126
126
const appStore = useAppStore ( )
127
127
appStore . updateSettings ( { globalSettings : true } )
128
128
}
129
129
130
+ if ( isV1 ) {
131
+ try {
132
+ error . response . data = JSON . parse ( error . response . data )
133
+ } catch ( e ) {
134
+ //
135
+ }
136
+ }
137
+
130
138
const { data } = error . response
131
139
132
140
const isInflux = ! ! error . config . url ?. startsWith ( `/v1/influxdb` )
You can’t perform that action at this time.
0 commit comments