|
|
@@ -33,7 +33,6 @@ $style.setAttribute("type", "text/css");
|
|
|
document.body.appendChild($style);
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
if (!to.name || to.name === RouteName.viewLayout) {
|
|
|
- console.log('appId', appId)
|
|
|
// router.replace({ name: RouteName.scene });
|
|
|
if(['criminal'].includes(appId)){
|
|
|
// criminal跳转
|
|
|
@@ -46,6 +45,7 @@ router.beforeEach((to, from, next) => {
|
|
|
const applyThemeAndNext = async () => {
|
|
|
try {
|
|
|
// 离线模式:从本地离线包的 data.json 读取主题色
|
|
|
+ console.log(isOfflineMode(), 'isOfflineMode()')
|
|
|
if (isOfflineMode()) {
|
|
|
try {
|
|
|
const base = getOfflineDataPath();
|
|
|
@@ -54,10 +54,13 @@ router.beforeEach((to, from, next) => {
|
|
|
`/package/data.json`,
|
|
|
]);
|
|
|
const entry = dict["/fusion/systemSetting/list"];
|
|
|
- const list: any[] = Array.isArray(entry?.data)
|
|
|
- ? entry.data
|
|
|
- : (Array.isArray(entry?.list) ? entry.list : []);
|
|
|
- const item = list.find((it) => it.platformKey === appId);
|
|
|
+ const list: any[] = Array.isArray(entry?.data) ? entry.data : (Array.isArray(entry?.list) ? entry.list : []);
|
|
|
+ let params = window.location.hash;
|
|
|
+ let query = params.indexOf('?') > -1 ? params.split('?')[1] : '';
|
|
|
+ let fromRoute = (new URLSearchParams(query).get('fromRoute') || appId).toLowerCase();
|
|
|
+ console.log('platformKey', params, query, fromRoute)
|
|
|
+ const item = list.find((it) => it.platformKey === fromRoute);
|
|
|
+ console.log('item', item)
|
|
|
if (item) {
|
|
|
localStorage.setItem('f-themeColour', item.themeColour);
|
|
|
const key = Object.keys(modules).find((key) => key.includes(item.themeColour));
|