环境打包
This commit is contained in:
15
src/App.vue
15
src/App.vue
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<div id="appaaaa">
|
||||
<router-view />
|
||||
<theme-picker />
|
||||
</div>
|
||||
@@ -12,22 +12,11 @@ export default {
|
||||
name: "App",
|
||||
components: { ThemePicker },
|
||||
created() {
|
||||
// const query = {
|
||||
// pageNum: 1,
|
||||
// pageSize: 100,
|
||||
// dictType: 'sys_title',
|
||||
// }
|
||||
// this.$store.dispatch("getDict", query).then((res) => {
|
||||
// let dictList = JSON.stringify(res.rows)
|
||||
// this.$cache.session.set('dictList', dictList);
|
||||
// }).catch(() => {
|
||||
|
||||
// })
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
#app .theme-picker {
|
||||
.theme-picker {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -27,8 +27,7 @@ Vue.prototype.$px2rem = px2rem;
|
||||
Vue.prototype.$dictLabel = dictLabel;
|
||||
Vue.directive("px", px2remDirective);
|
||||
|
||||
import './assets/icons' // icon
|
||||
import './permission' // permission control
|
||||
import './assets/icons' // icon/ permission control
|
||||
import { getDicts } from "@/api/system/dict/data"
|
||||
import { getConfigKey } from "@/api/system/config"
|
||||
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message } from 'element-ui'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { isPathMatch } from '@/utils/validate'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
const whiteList = ['/login', '/register']
|
||||
|
||||
const isWhiteList = (path) => {
|
||||
return whiteList.some(pattern => isPathMatch(pattern, path))
|
||||
}
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
// if (getToken()) {
|
||||
// to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
// /* has token*/
|
||||
// if (to.path === '/login') {
|
||||
// next({ path: '/' })
|
||||
// NProgress.done()
|
||||
// } else if (isWhiteList(to.path)) {
|
||||
// next()
|
||||
// } else {
|
||||
// if (store.getters.roles.length === 0) {
|
||||
// isRelogin.show = true
|
||||
// // 判断当前用户是否已拉取完user_info信息
|
||||
// store.dispatch('GetInfo').then(() => {
|
||||
// isRelogin.show = false
|
||||
// store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||
// // 根据roles权限生成可访问的路由表
|
||||
// router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
// next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
// })
|
||||
// }).catch(err => {
|
||||
// store.dispatch('LogOut').then(() => {
|
||||
// Message.error(err)
|
||||
// next({ path: '/' })
|
||||
// })
|
||||
// })
|
||||
// } else {
|
||||
// next()
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// 没有token
|
||||
// if (isWhiteList(to.path)) {
|
||||
// 在免登录白名单,直接进入
|
||||
// if (store.getters.dictList.length === 0) {
|
||||
// const query = {
|
||||
// pageNum: 1,
|
||||
// pageSize: 100,
|
||||
// dictType: "sys_title",
|
||||
// };
|
||||
// store
|
||||
// .dispatch("getDict", query)
|
||||
// .then((res) => {
|
||||
// next();
|
||||
// // let dictList = JSON.stringify(res.rows);
|
||||
// // this.$cache.session.set("dictList", dictList);
|
||||
// })
|
||||
// .catch(() => {});
|
||||
|
||||
// } else {
|
||||
next();
|
||||
// }
|
||||
// next()
|
||||
// } else {
|
||||
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页
|
||||
// NProgress.done()
|
||||
// }
|
||||
// }
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
NProgress.done()
|
||||
})
|
||||
@@ -66,7 +66,7 @@ export const constantRoutes = [
|
||||
// component: Layout,
|
||||
name: "Layout_main",
|
||||
component: () => import("@/views/bigScreen/Layout_main/index.vue"),
|
||||
redirect: "home",
|
||||
redirect: "/home",
|
||||
children: [
|
||||
// {
|
||||
// path: 'index',
|
||||
@@ -233,7 +233,7 @@ Router.prototype.replace = function push(location) {
|
||||
}
|
||||
|
||||
export default new Router({
|
||||
mode: 'history', // 去掉url中的#
|
||||
mode: 'hash', // 加上#
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRoutes
|
||||
})
|
||||
|
||||
@@ -518,7 +518,7 @@ export function drawAxes(element, options = {}, ballCallBack) {
|
||||
composer.addPass(fxaa);
|
||||
|
||||
/* ========== 环境光照/HDR环境贴图 ========== */
|
||||
new RGBELoader().load("/hdr/basic.hdr", (tex) => {
|
||||
new RGBELoader().load(process.env.VUE_APP_BASE_URL + "/hdr/basic.hdr", (tex) => {
|
||||
tex.mapping = THREE.EquirectangularReflectionMapping;
|
||||
scene.environment = tex;
|
||||
});
|
||||
@@ -606,7 +606,7 @@ export function drawAxes(element, options = {}, ballCallBack) {
|
||||
|
||||
const img = document.createElement('img')
|
||||
|
||||
img.src = `/icon_xz/${axes}0${i}.png`
|
||||
img.src = process.env.VUE_APP_BASE_URL + `/icon_xz/${axes}0${i}.png`
|
||||
|
||||
img.style.width = '10px'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user