ÎļþÃû´Ó src/main.ts ÐÞ¸Ä |
| | |
| | | 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') |
| | |
| | | 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) |
| | | |
| | | |