Skip to content

Commit be829bc

Browse files
committed
2024年3月20日22:53:24
1 parent d4bec52 commit be829bc

File tree

3 files changed

+45
-48
lines changed

3 files changed

+45
-48
lines changed

src/css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
body {
22
/*背景图片*/
3-
background-image: url('https://dogefs.s3.ladydaily.com/~/source/wallhaven/full/jx/wallhaven-jxl3qp.jpg?w=2560&h=1440&fmt=webp');
3+
/* background-image: url('https://dogefs.s3.ladydaily.com/~/source/wallhaven/full/jx/wallhaven-jxl3qp.jpg?w=2560&h=1440&fmt=webp'); */
44
background-repeat: no-repeat;
55
background-size: cover;
66
}

src/main.js

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
1-
import './assets/main.css'
1+
import "./assets/main.css";
22

3-
import {createApp} from 'vue'
4-
import App from './App.vue'
5-
import router from '@/router'
3+
import { createApp } from "vue";
4+
import App from "./App.vue";
5+
import router from "@/router";
66
import ElementPlus from "element-plus";
7-
import 'element-plus/dist/index.css'
8-
import 'element-plus/theme-chalk/dark/css-vars.css'
9-
import {createPersistedState} from "pinia-persistedstate-plugin";
10-
11-
import '@/css/main.css';
12-
import {createPinia} from "pinia";
13-
7+
import "element-plus/dist/index.css";
8+
import "element-plus/theme-chalk/dark/css-vars.css";
9+
import { createPersistedState } from "pinia-persistedstate-plugin";
1410

11+
import "@/css/main.css";
12+
import { createPinia } from "pinia";
1513

1614
// 导入element-plus中文语言
17-
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
18-
const app = createApp(App)
15+
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
16+
const app = createApp(App);
1917

2018
// 使用pinia和persist保存状态并持久化
2119
const pinia = createPinia();
2220
const persist = createPersistedState();
2321
pinia.use(persist);
2422

25-
app.use(ElementPlus, {locale: zhCn,});
23+
app.use(ElementPlus, { locale: zhCn });
2624
app.use(router);
2725
app.use(pinia);
2826

29-
app.mount('#app')
30-
31-
27+
app.mount("#app");

vite.config.js

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
1-
import {fileURLToPath, URL} from 'node:url'
1+
import { fileURLToPath, URL } from "node:url";
22

3-
import {defineConfig} from 'vite'
4-
import vue from '@vitejs/plugin-vue'
5-
import AutoImport from 'unplugin-auto-import/vite'
6-
import Components from 'unplugin-vue-components/vite'
7-
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
3+
import { defineConfig } from "vite";
4+
import vue from "@vitejs/plugin-vue";
5+
import AutoImport from "unplugin-auto-import/vite";
6+
import Components from "unplugin-vue-components/vite";
7+
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
88

99
// https://vitejs.dev/config/
1010
export default defineConfig({
11-
plugins: [
12-
vue(),
13-
AutoImport({
14-
resolvers: [ElementPlusResolver()],
15-
}),
16-
Components({
17-
resolvers: [ElementPlusResolver()],
18-
}),
19-
],
20-
resolve: {
21-
alias: {
22-
'@': fileURLToPath(new URL('./src', import.meta.url))
23-
}
11+
plugins: [
12+
vue(),
13+
AutoImport({
14+
resolvers: [ElementPlusResolver()],
15+
}),
16+
Components({
17+
resolvers: [ElementPlusResolver()],
18+
}),
19+
],
20+
resolve: {
21+
alias: {
22+
"@": fileURLToPath(new URL("./src", import.meta.url)),
2423
},
25-
//代理http请求,解决跨域问题
26-
server: {
27-
// host: '192.168.0.66',
28-
host: 'localhost',
29-
port: 5173,
30-
proxy: {
24+
},
25+
//代理http请求,解决跨域问题
26+
server: {
27+
// host: '192.168.0.66',
28+
// 前端地址
29+
host: "localhost",
30+
port: 5173,
31+
proxy: {
3132
'/api': { //匹配请求路径中含有 /api 的请求
3233
// target: 'http://47.115.226.138:8080', //后端服务地址
3334
target: 'http://localhost:8080', //后端服务地址
34-
changeOrigin: true,
35-
rewrite: (path) => path.replace(/^\/api/, '') //去除路径中的/api,还原请求路径
36-
}
37-
}
35+
changeOrigin: true,
36+
rewrite: (path) => path.replace(/^\/api/, ""), //去除路径中的/api,还原请求路径
37+
},
3838
},
39-
})
39+
},
40+
});

0 commit comments

Comments
 (0)