Skip to content

Commit

Permalink
fix(axios.js): axios-x
Browse files Browse the repository at this point in the history
  • Loading branch information
supersonictw committed Oct 11, 2024
1 parent f6eea61 commit 9e0e41d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
8 changes: 3 additions & 5 deletions src/plugins/axios.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ axiosClient.interceptors.response.use(

const extension = {
install: (Vue) => {
Vue.axios = axiosClient;
window.axios = axiosClient;
Object.defineProperties(Vue.prototype, {
axios: axiosClient,
$axios: axiosClient,
});
Vue.axios = axiosClient;
Vue.prototype.axios = axiosClient;
Vue.prototype.$axios = axiosClient;
},
};

Expand Down
15 changes: 7 additions & 8 deletions src/plugins/sara.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,15 @@ const getProfile = async () => {

const extension = {
install: (Vue) => {
Vue.sara = axiosClient;
Vue.profile = getProfile;
window.sara = axiosClient;
Vue.sara = axiosClient;
Vue.prototype.sara = axiosClient;
Vue.prototype.$sara = axiosClient;

window.profile = getProfile;
Object.defineProperties(Vue.prototype, {
sara: axiosClient,
$sara: axiosClient,
profile: getProfile,
$profile: getProfile,
});
Vue.profile = getProfile;
Vue.prototype.profile = getProfile;
Vue.prototype.$profile = getProfile;
},
};

Expand Down

0 comments on commit 9e0e41d

Please sign in to comment.