zmc
2023-09-27 eeef5d4039d2b3fee6854ddc2789aa23232b2cfb
src/main.js
ÎļþÃû´Ó src/main.ts ÐÞ¸Ä
@@ -1,26 +1,16 @@
import { createApp } from 'vue'
// import { createPinia } from 'pinia'
import Cookie from 'js-cookie'
import App from './App.vue'
import router from './router'
import "@/style/index.scss"
import "@/style/index.css"
import axios from 'axios'
import { ElMessage } from 'element-plus'
// å…¨å±€å¼•入样式
import 'element-plus/theme-chalk/src/index.scss'
const app = createApp(App)
// function SecretPiniaPlugin() {
//     return { secret: 'the cake is a lie',vue:'333.0' }
//   }
//   const pinia = createPinia()
//   // å°†æ’件提供给 pinia
//   pinia.use(SecretPiniaPlugin)
  // pinia.use(() => ({'天':'雨天'}))
router.beforeEach((to,from,next)=>{
  const token = Cookie.get('token')
@@ -34,12 +24,14 @@
    next()
  }
})
// axios.defaults.baseURL = 'http://192.168.1.4:8081'
// æœ¬åœ°
// axios.defaults.baseURL = 'http://localhost:8081'
// éƒ¨ç½²
axios.defaults.baseURL = 'http://114.215.109.124:8803'
app.config.globalProperties.$http = axios
// app.use(pinia)
app.use(ElMessage)
app.config.globalProperties.$message = ElMessage
app.use(router)