mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
W / Axios
- This plugin will add axios (this.$axios) with custom functions
Required internal plugins
- w/auth
Installation
- Install plugin in
main.ts
import axios from '@/plugins/w/axios'
const app = createApp(App)
.use(auth)
.use(axios)
- Create
.envin app root directory - Add
VUE_APP_WAXIOS_URL=defaultBaseUrlto.env
Examples
- Call without authorization header
this.$axios.get('v1/courses')
- Call with authorization header
this.$axios.get_auth('v1/courses')
- Call that will return directly response.data.data
this.$axios.get_data('v1/courses')
this.$axios.get_auth_data('v1/courses')
Public functions
async get(url: string, config?: any)
async get_data(url: string, config?: any)
async get_auth(url: string, config?: any)
async get_auth_data(url: string, config?: any)
async post(url: string, config?: any)
async post_data(url: string, config?: any)
async post_auth(url: string, config?: any)
async post_auth_data(url: string, config?: any)
async patch(url: string, config?: any)
async patch_data(url: string, config?: any)
async patch_auth(url: string, config?: any)
async patch_auth_data(url: string, config?: any)
async delete(url: string, config?: any)
async delete_data(url: string, config?: any)
async delete_auth(url: string, config?: any)
async delete_auth_data(url: string, config?: any)