Skip to content

Commit

Permalink
axios设置全局路径
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryJi529 committed May 31, 2024
1 parent 418b24e commit e4ff270
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions apps/formula/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import { createApp } from 'vue'
import MathJax, { initMathJax, renderByMathjax } from "mathjax-vue3";
import App from './App.vue'

import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL

function onMathJaxReady() {
const el = document.getElementById("formulaDisplay");
renderByMathjax(el);
Expand Down
1 change: 0 additions & 1 deletion apps/joke/frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { RouterLink, RouterView } from 'vue-router'
import GithubCorners from '@uivjs/vue-github-corners';
import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL
const endpoint = "/jokes/?n=30"
import Nav from "./components/Nav.vue"
Expand Down
3 changes: 3 additions & 0 deletions apps/joke/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { createPinia } from 'pinia'

import MasonryWall from '@yeger/vue-masonry-wall'

import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL

/* import the fontawesome core */
import { library } from '@fortawesome/fontawesome-svg-core'
/* import font awesome icon component */
Expand Down
2 changes: 2 additions & 0 deletions apps/notes/frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createApp } from 'vue'
import App from './App.vue'
import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL

/* import the fontawesome core */
import { library } from '@fortawesome/fontawesome-svg-core'
Expand Down
4 changes: 4 additions & 0 deletions apps/quiz/frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { createApp } from 'vue'

import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL

import App from './App.vue'
import router from './router/index'
import './assets/main.css'
Expand Down
2 changes: 0 additions & 2 deletions apps/quiz/frontend/src/views/QuizzesView.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script setup>
import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL
import { ref, watch, onMounted } from 'vue'
import gsap from 'gsap'
import NSpin from 'naive-ui'
Expand Down
1 change: 0 additions & 1 deletion apps/recognizer/frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {onMounted, ref } from "vue"
import axios from "axios";
import Cookies from "js-cookie"
axios.defaults.baseURL = process.env.BASE_URL
import Header from "./components/Header.vue"
import Footer from "./components/Footer.vue"
Expand Down
4 changes: 4 additions & 0 deletions apps/recognizer/frontend/src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import "./assets/css/tailwindcss.css"

import { createApp } from 'vue'

import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL

import App from './App.vue'

createApp(App).mount('#app')
3 changes: 3 additions & 0 deletions apps/share/frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import './assets/css/tailwindcss.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'

import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL

/* import the fontawesome core */
import { library } from '@fortawesome/fontawesome-svg-core'
/* import font awesome icon component */
Expand Down
2 changes: 0 additions & 2 deletions apps/share/frontend/src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import {onMounted, ref} from 'vue'
import axios from 'axios';
import {useRoute} from 'vue-router'
import Cookies from 'js-cookie'
const baseURL = process.env.BASE_URL
axios.defaults.baseURL = baseURL
const route = useRoute()
const currentPath = ref(window.location.href)
Expand Down
2 changes: 0 additions & 2 deletions apps/share/frontend/src/views/RedirectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
import {ref, onMounted} from 'vue'
import {useRoute} from 'vue-router'
import axios from 'axios';
const baseURL = process.env.BASE_URL
axios.defaults.baseURL = baseURL
const route = useRoute()
const endpoint = `/route/${route.params.id}/`
Expand Down
1 change: 0 additions & 1 deletion extension/popup/src/components/Image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { onMounted, ref } from "vue";
import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL
const endpoint = "/joke/photos/?n=1"
const host = process.env.BASE_URL.split('/').slice(0, 3).join('/')
Expand Down
3 changes: 3 additions & 0 deletions extension/popup/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import './assets/tailwindcss.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'

import axios from "axios";
axios.defaults.baseURL = process.env.BASE_URL

import App from './App.vue'
// import router from './router'

Expand Down

0 comments on commit e4ff270

Please sign in to comment.