Skip to content

Commit 37ee87c

Browse files
committed
V2.0.0
1 parent d505b7b commit 37ee87c

File tree

8 files changed

+27
-140
lines changed

8 files changed

+27
-140
lines changed

docs/assets/index.227dd38f.js

Lines changed: 0 additions & 128 deletions
This file was deleted.

docs/assets/index.78bc41ed.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
77
<title>Vue + ElementPlus 搭建的一个后台管理页面骨架</title>
88

9-
<script type="module" crossorigin src="assets/index.227dd38f.js"></script>
10-
<link rel="stylesheet" href="assets/index.78bc41ed.css">
9+
<script type="module" crossorigin src="assets/index.1fccf380.js"></script>
10+
<link rel="stylesheet" href="assets/index.d784a310.css">
1111
</head>
1212
<body>
1313
<div id="app"></div>

src/components/aframe/vel-frame-welcome.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<el-col :span="24">
55
<el-card shadow="never" class="vel_el_card_override vel_el_card_introduce">
66
<div class="introduce_avatar">
7-
<el-avatar :size="60" :src="'/static/imgs/jimeng.webp'"/>
7+
<el-avatar :size="60" :src="avatarUrl"/>
88
</div>
99
<div class="introduce_desc">
1010
<p class="tit">你好呀,{{ userNick }},又是元气满满的一天!</p>
@@ -182,18 +182,20 @@
182182
</template>
183183

184184
<script setup>
185-
import {ref, computed, getCurrentInstance} from "vue";
185+
import {computed, getCurrentInstance} from "vue";
186186
import EchartsDemo1 from "../commons/welcome/echarts-demo-1.vue";
187187
import EchartsDemo2 from "../commons/welcome/echarts-demo-2.vue";
188188
import EchartsDemo3 from "../commons/welcome/echarts-demo-3.vue";
189189
import TableDemo1 from "../commons/welcome/table-demo-1.vue";
190190
import ProgressDemo1 from "../commons/welcome/progress-demo-1.vue";
191191
import * as Constant from "../../config/constant";
192+
import envConfig from "../../config/envConfig";
192193
193194
const globalCfg = getCurrentInstance().appContext.config.globalProperties
194195
195196
const name = 'vel-frame-welcome'
196-
const githubUrl = ref('https://github.com/mutolee/vel-admin-web')
197+
const githubUrl = 'https://github.com/mutolee/vel-admin-web'
198+
const avatarUrl = envConfig.baseUrl() + '/static/imgs/jimeng.webp'
197199
198200
// 用户名称
199201
const userNick = computed(() => globalCfg.$store.getters[Constant.USERINFO_USER_NICK_GET_KEY])

src/config/envConfig.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {BASE_URL, BASE_URL_DEV} from "./constant";
2+
3+
/**
4+
* 根据环境获取Http请求所需要的baseUrl
5+
* @returns {string}
6+
*/
7+
const baseUrl = ()=>{
8+
return process.env.NODE_ENV === 'production' ? BASE_URL : BASE_URL_DEV
9+
}
10+
11+
export default {
12+
baseUrl
13+
}

src/config/httpConfig.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import axios from 'axios'
22
import {isAuthenticated, logout} from "../router/modules/auth";
3-
import {BASE_URL, BASE_URL_DEV, STATUS_CODE} from "./constant";
3+
import envConfig from "./envConfig";
44
import {ElMessage} from "element-plus";
55

6-
76
/**
87
* 创建一个Axios实例,应用中的请求基于该实例配置
98
* <br/>
109
* 文档地址:https://axios-http.com/zh/docs/intro
1110
*/
1211
const service = axios.create({
1312
// 配置当前实例的BaseURL
14-
baseURL: process.env.NODE_ENV === 'production' ? BASE_URL : BASE_URL_DEV, // 配置当前实例的超时时间
13+
baseURL: envConfig.baseUrl(), // 配置当前实例的超时时间
1514
timeout: 10 * 1000
1615
})
1716

src/router/modules/routes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ let loopRoutes = (routesArr, routes, breadcrumb) => {
127127
// router.addRoute() 挂载到路由系统中
128128
// 关于路由懒加载,文档地址:https://router.vuejs.org/zh/guide/advanced/lazy-loading.html
129129
let addRoute = (routesArr) => {
130-
130+
// 导入所有vue视图模块
131+
const modules = import.meta.globEager("../../components/views/**/*.vue")
131132
for (let i = 0; i < routesArr.length; i++) {
132133
let route = routesArr[i]
133134
// 过滤掉内置的静态路由
@@ -137,7 +138,7 @@ let addRoute = (routesArr) => {
137138
// 添加子路由,子路由挂载在`gen`路由下
138139
router.addRoute('gen', {
139140
path: route.path, // 路由懒加载
140-
component: () => import(`../../components/views${route.component}.vue`)
141+
component: modules[`../../components/views${route.component}.vue`].default
141142
});
142143
}
143144

src/vuex/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createStore } from 'vuex'
1+
import {createStore} from 'vuex'
22

33
// 模块化管理Vue中的状态
44
let modules = {}
@@ -11,6 +11,7 @@ let modulesFiles = import.meta.globEager('./modules/*.js')
1111

1212
// 遍历所有模块进行装配
1313
for (let path in modulesFiles) {
14+
console.log(path)
1415
let module = modulesFiles[path].default
1516
modules[module.name] = module
1617
}

0 commit comments

Comments
 (0)