Skip to content

Commit

Permalink
fix: 🧩 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
17359898647 committed Nov 6, 2023
1 parent 2dc84d3 commit 646259f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import axios from 'axios'
import type { useRequestParams, useRequestReturn } from '@/composables/useRequest'
import { useRequest } from '@/composables/useRequest'

console.log(import.meta.env.VITE_BASEURL)
const instance = axios.create({
baseURL: import.meta.env.DEV ? '/api' : import.meta.env.VITE_BASEURL,
headers: {
Expand Down Expand Up @@ -34,7 +33,6 @@ instance.interceptors.request.use(
*/
instance.interceptors.response.use(
(response) => {
console.log(response)
return response
},
(error) => {
Expand Down
12 changes: 6 additions & 6 deletions src/composables/useRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ export function useRequest<T = unknown>(instance: AxiosInstance, options: useReq
})
return {
..._useAxios,
data: computed({
get: () => {
return _useAxios.data.value
},
set: val => _useAxios.data.value = val,
}),
// data: computed({
// get: () => {
// return _useAxios.data.value
// },
// set: val => _useAxios.data.value = val,
// }),
execute: (executeUrl?: MaybeRefOrGetter<string>) => {
const _executeUrl = toValue(executeUrl)
return _useAxios.execute(isUndefined(_executeUrl) ? _url.value : _executeUrl) as Promise<useRequestReturn<T>>
Expand Down

0 comments on commit 646259f

Please sign in to comment.