修改黑屏问题
This commit is contained in:
parent
5ec53f7fd0
commit
a6d04d22ad
@ -11,7 +11,7 @@ VITE_PORT = 9530
|
||||
VITE_MODE = 'DEV'
|
||||
VITE_APP_TITLE = '政务云数字农业智慧大屏'
|
||||
VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://localhost:9000'
|
||||
VITE_APP_MIAN_URL = 'http://localhost:9530'
|
||||
VITE_APP_NAME = 'new-digital-agriculture-screen'
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
|
16
src/main.js
16
src/main.js
@ -6,7 +6,7 @@
|
||||
* @LastEditTime: 2024-03-22 10:11:34
|
||||
*/
|
||||
import 'virtual:svg-icons-register';
|
||||
import { createApp } from 'vue';
|
||||
import { createApp, nextTick } from 'vue';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import pinia from './store';
|
||||
@ -15,6 +15,7 @@ import 'element-plus/dist/index.css';
|
||||
import Avue from '@smallwei/avue';
|
||||
import '@smallwei/avue/lib/index.css';
|
||||
import './utils/permission';
|
||||
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap';
|
||||
import { registerDirective } from './directives';
|
||||
import { registerGlobalComponents } from './plugins/globalComponents';
|
||||
import { registerElIcons } from './plugins/icon';
|
||||
@ -23,8 +24,11 @@ import { registerMicroApps } from './plugins/micro';
|
||||
const app = createApp(App);
|
||||
// 注册 Vue3 Scroll Seamless 组件
|
||||
// app.component('Vue3ScrollSeamless', vue3ScrollSeamless);
|
||||
app.use(pinia).use(router).use(ElementPlus).use(Avue);
|
||||
registerGlobalComponents(app);
|
||||
registerElIcons(app);
|
||||
registerDirective(app);
|
||||
registerMicroApps(app);
|
||||
// app.use(pinia).use(router).use(ElementPlus).use(Avue);
|
||||
app.use(pinia).use(router).use(ElementPlus).use(Avue).use(VueAMap);
|
||||
nextTick(() => {
|
||||
registerGlobalComponents(app);
|
||||
registerElIcons(app);
|
||||
registerDirective(app);
|
||||
registerMicroApps(app);
|
||||
});
|
||||
|
@ -35,6 +35,11 @@ router.beforeEach(async (to, from, next) => {
|
||||
accessRoutes.forEach((item) => router.addRoute(item));
|
||||
return next({ ...to, replace: true });
|
||||
} else {
|
||||
if (from.path.includes('/new') && to.path.includes('/platform')) {
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
next();
|
||||
next();
|
||||
}
|
||||
} catch (error) {
|
||||
|
@ -23,7 +23,7 @@ import { resolve } from 'path';
|
||||
const useDevMode = true;
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const { VITE_PORT, VITE_APP_NAME, VITE_APP_BASE_API, VITE_APP_BASE_URL, VITE_APP_UPLOAD_API, VITE_APP_UPLOAD_URL } = loadEnv(mode, process.cwd());
|
||||
const { VITE_APP_MIAN_URL, VITE_PORT, VITE_APP_NAME, VITE_APP_BASE_API, VITE_APP_BASE_URL, VITE_APP_UPLOAD_API, VITE_APP_UPLOAD_URL } = loadEnv(mode, process.cwd());
|
||||
const config = {
|
||||
base: '/new-digital-agriculture-screen/',
|
||||
build: {
|
||||
@ -36,7 +36,7 @@ export default defineConfig(({ command, mode }) => {
|
||||
port: VITE_PORT,
|
||||
open: true,
|
||||
https: false,
|
||||
origin: 'http://localhost:9530',
|
||||
origin: VITE_APP_MIAN_URL,
|
||||
headers: {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user