diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue index 9b6b924..30c0d87 100644 --- a/src/components/ThemePicker/index.vue +++ b/src/components/ThemePicker/index.vue @@ -20,8 +20,12 @@ export default { } }, created() { - this.theme = Cookies.get("defaultTheme") - document.body.style.setProperty('--theme-color', Cookies.get("defaultTheme")); + }, + mounted() { + this.$nextTick(() => { + this.theme = Cookies.get("defaultTheme") + document.body.style.setProperty('--theme-color', Cookies.get("defaultTheme")); + }) }, computed: { diff --git a/src/main.js b/src/main.js index b3deed8..1b791ac 100644 --- a/src/main.js +++ b/src/main.js @@ -56,6 +56,8 @@ Vue.use(Wujie); const { setupApp, preloadApp } = Wujie; setupApp({ name: "modules", + sync: true, + alive: true, url: "http://localhost:9530/admin/#/", exec: true, }); diff --git a/src/permission.js b/src/permission.js index c99378e..dd8d4e8 100644 --- a/src/permission.js +++ b/src/permission.js @@ -28,6 +28,7 @@ router.beforeEach(async(to, from, next) => { NProgress.done() } else { if (to.meta.isModule) { + store.commit('modules/SET_MODULE_NAME',to.meta.moduleName) store.commit('modules/SET_MODULE_URI',to.meta.moduleUri) } diff --git a/src/store/getters.js b/src/store/getters.js index 03bb61d..f303f5e 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -8,6 +8,7 @@ const getters = { admins: state => state.data.admins, departments: state => state.data.departments, permission_routes: state => state.permission.routes, - module_uri: state => state.modules.moduleUri + module_uri: state => state.modules.moduleUri, + module_name: state => state.modules.moduleName } export default getters diff --git a/src/store/modules/modules.js b/src/store/modules/modules.js index d28de84..fbe608e 100644 --- a/src/store/modules/modules.js +++ b/src/store/modules/modules.js @@ -1,11 +1,14 @@ const state = { - moduleUri: "" + moduleUri: "", + moduleName: "", } const mutations = { SET_MODULE_URI: (state, uri) => { state.moduleUri = uri }, - + SET_MODULE_NAME: (state, name) => { + state.moduleName = name + }, } const actions = { diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 533235b..f70dd46 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -37,7 +37,8 @@ export function filterAsyncRoutes(routes) { guard: route.guard_name, folder: route.folder, isModule: !/^\/./.test(route.path), - moduleUri: /^\/./.test(route.path) ? '' : `${process.env.VUE_APP_BASE_API}/${route.path}`, + moduleUri: /^\/./.test(route.path) ? '' : `http://localhost:9529/${route.path}`, + moduleName: /^\/./.test(route.path) ? '' : route.path, } } @@ -71,7 +72,6 @@ const actions = { accessedRoutes = filterAsyncRoutes(routes) //把404拦截放在最后匹配 accessedRoutes.push({ path: '*', redirect: '/404', hidden: true }) - console.log(333,accessedRoutes) commit('SET_ROUTES', accessedRoutes) resolve(accessedRoutes) } catch (err) { diff --git a/src/styles/navbar.scss b/src/styles/navbar.scss index 78a6da9..b97a248 100644 --- a/src/styles/navbar.scss +++ b/src/styles/navbar.scss @@ -2839,7 +2839,7 @@ progress { --tblr-navbar-toggler-focus-width: 0; --tblr-navbar-toggler-transition: box-shadow 0.15s ease-in-out; position: relative; - z-index: 9999999; + z-index: 999; display: flex; flex-wrap: wrap; align-items: center; diff --git a/src/views/wujie/index.vue b/src/views/wujie/index.vue index 4028973..c95e909 100644 --- a/src/views/wujie/index.vue +++ b/src/views/wujie/index.vue @@ -3,7 +3,6 @@ width="100%" height="100%" name="modules" - sync :url="module_uri" :props="props"> @@ -20,18 +19,21 @@ export default { data() { return { props: { - auth_token: "" + auth_token: "", + module_name: "", } } }, methods: {}, computed: { - ...mapGetters(['module_uri']) + ...mapGetters(['module_uri','module_name']) }, watch: { module_uri: { handler:function(newVal) { - this.props.auth_token = getToken() + this.props.module_name = this.module_name; + this.props.auth_token = getToken(); + }, immediate: true }