项目调整
This commit is contained in:
@@ -8,7 +8,6 @@ export function createPermissionGuard(router: Router, whiteNameList: string[]) {
|
||||
const authorizationStore = authorizationService();
|
||||
const appConfig = appConfigStore();
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
next();
|
||||
if (!appConfig.userCustomRouterGuard) {
|
||||
setRouteChange(to);
|
||||
if (to?.query?.nervsid) {
|
||||
|
@@ -1,9 +1,8 @@
|
||||
|
||||
|
||||
import { log } from '/nerv-lib/util';
|
||||
import { appConfigStore } from '/nerv-lib/saas/store/modules/app-config';
|
||||
let modules = import.meta.globEager('/src/router/**/*.ts');
|
||||
const modulesOP = import.meta.globEager('/src/router-op/**/*.ts');
|
||||
console.log(modules);
|
||||
|
||||
const modulesCloud = import.meta.globEager('/src/router-cloud/**/*.ts');
|
||||
import { appConfig } from '/@/config/app.config.ts';
|
||||
|
@@ -72,7 +72,7 @@
|
||||
*/
|
||||
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
// scrollbar-width: thin;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
|
@@ -13,8 +13,8 @@
|
||||
:initSiderKey="selectedSiderKeys"
|
||||
:initSiderOpenKey="selectedSiderOpenKeys" />
|
||||
<a-layout>
|
||||
<!-- <newNsTags v-if="configStore.useHistoryTag" /> -->
|
||||
<ns-tags />
|
||||
<newNsTags v-if="configStore.useHistoryTag" />
|
||||
<ns-tags v-else />
|
||||
<!-- <NsBreadcrumb v-else :breadcrumbList="breadcrumbList" /> -->
|
||||
<a-layout-content class="ns-content">
|
||||
<!-- <transition name="fade-slide" mode="out-in"> -->
|
||||
@@ -73,6 +73,7 @@
|
||||
authorizationStore.setProjectId(Cookies.get('projectUuid'));
|
||||
}
|
||||
const { route: routeModules, routeModuleObject, routeModule } = storeToRefs(useRouteStore());
|
||||
console.log(routeModules, 'routeModules');
|
||||
|
||||
const headers = computed(() => {
|
||||
const module = cloneDeep(routeModules.value);
|
||||
|
@@ -22,7 +22,7 @@
|
||||
<template #tab>
|
||||
<a-dropdown :trigger="index === 0 ? [] : ['contextmenu']">
|
||||
<div>
|
||||
{{ item?.meta?.title }}
|
||||
{{ item?.title }}
|
||||
<ReloadOutlined
|
||||
@click="reload"
|
||||
v-if="
|
||||
@@ -94,6 +94,8 @@
|
||||
const loadingClass = ref('reload');
|
||||
const keepAliveStore = useKeepAlive();
|
||||
const getTabsState = computed(() => tagsStore.getTags);
|
||||
console.log(getTabsState);
|
||||
|
||||
const reload = () => {
|
||||
setReloadChange();
|
||||
loadingClass.value = 'iconLoading';
|
||||
|
@@ -16,7 +16,7 @@
|
||||
backgroundSize: 'cover',
|
||||
}">
|
||||
<div class="lg_card">
|
||||
<h1 class="lg_card_title">账号登录</h1>
|
||||
<h1 class="lg_card_title">账号登录cur</h1>
|
||||
<p v-show="!errorShow" style="height: 8px"></p>
|
||||
<p v-show="errorShow" class="lg_card_error">{{ errorMsg }}</p>
|
||||
<p class="lg_card_tip">用户名/手机号</p>
|
||||
@@ -86,64 +86,67 @@
|
||||
if (userName.value !== '' && password.value !== '') {
|
||||
errorShow.value = false;
|
||||
let data = JSON.stringify({ userName: userName.value, password: password.value });
|
||||
loading.value = true;
|
||||
async function logins() {
|
||||
try {
|
||||
const res = await configStore.userLogin(JSON.parse(data));
|
||||
if (res.success) {
|
||||
if (res.data?.userToken) {
|
||||
Cookies.set('nervsid', res.data?.userToken);
|
||||
}
|
||||
const info = await configStore.userInfo();
|
||||
info.success
|
||||
? window.sessionStorage.setItem('userInfo', JSON.stringify(info.data))
|
||||
: '';
|
||||
loading.value = false;
|
||||
if (configStore.enablePermissions) {
|
||||
const res = await configStore.userResource();
|
||||
if (configStore.customApplication) {
|
||||
await useAuthorization.initMenuResource();
|
||||
}
|
||||
Cookies.set('nervsid', 'mockdata');
|
||||
router.replace({ name: 'root' });
|
||||
|
||||
initUrl.value = '';
|
||||
const dealInitUrl = (item) => {
|
||||
if (item.type === 'menus' && item.menus && item.menus?.length !== 0) {
|
||||
dealInitUrl(item.menus[0]);
|
||||
} else {
|
||||
// if (item.type === 'noChildrenMenu') {
|
||||
initUrl.value = configStore.resourceName
|
||||
? item.code.replace(configStore.resourceName, '')
|
||||
: item.code;
|
||||
// }
|
||||
}
|
||||
};
|
||||
if (configStore.resourceName) {
|
||||
const initResource = [];
|
||||
res.data.forEach((item) => {
|
||||
if (item.code.includes(configStore.resourceName)) {
|
||||
initResource.push(item);
|
||||
}
|
||||
});
|
||||
dealInitUrl(initResource[0]);
|
||||
} else {
|
||||
dealInitUrl(res.data[0]);
|
||||
}
|
||||
// dealInitUrl(res.data[0]);
|
||||
useAuthorization.updateUserResource(res.data);
|
||||
const initRouterList = useAuthorization.getInitRouterList;
|
||||
// loading.value = true;
|
||||
// async function logins() {
|
||||
// try {
|
||||
// const res = await configStore.userLogin(JSON.parse(data));
|
||||
// if (res.success) {
|
||||
// if (res.data?.userToken) {
|
||||
// Cookies.set('nervsid', res.data?.userToken);
|
||||
// }
|
||||
// const info = await configStore.userInfo();
|
||||
// info.success
|
||||
// ? window.sessionStorage.setItem('userInfo', JSON.stringify(info.data))
|
||||
// : '';
|
||||
// loading.value = false;
|
||||
// if (configStore.enablePermissions) {
|
||||
// const res = await configStore.userResource();
|
||||
// if (configStore.customApplication) {
|
||||
// await useAuthorization.initMenuResource();
|
||||
// }
|
||||
|
||||
router.push({
|
||||
name: initRouterList.length === 0 ? 'error403' : initUrl.value,
|
||||
});
|
||||
} else {
|
||||
router.replace({ name: 'root' });
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
logins();
|
||||
// initUrl.value = '';
|
||||
// const dealInitUrl = (item) => {
|
||||
// if (item.type === 'menus' && item.menus && item.menus?.length !== 0) {
|
||||
// dealInitUrl(item.menus[0]);
|
||||
// } else {
|
||||
// // if (item.type === 'noChildrenMenu') {
|
||||
// initUrl.value = configStore.resourceName
|
||||
// ? item.code.replace(configStore.resourceName, '')
|
||||
// : item.code;
|
||||
// // }
|
||||
// }
|
||||
// };
|
||||
// if (configStore.resourceName) {
|
||||
// const initResource = [];
|
||||
// res.data.forEach((item) => {
|
||||
// if (item.code.includes(configStore.resourceName)) {
|
||||
// initResource.push(item);
|
||||
// }
|
||||
// });
|
||||
// dealInitUrl(initResource[0]);
|
||||
// } else {
|
||||
// dealInitUrl(res.data[0]);
|
||||
// }
|
||||
// // dealInitUrl(res.data[0]);
|
||||
// useAuthorization.updateUserResource(res.data);
|
||||
// const initRouterList = useAuthorization.getInitRouterList;
|
||||
|
||||
// router.push({
|
||||
// name: initRouterList.length === 0 ? 'error403' : initUrl.value,
|
||||
// });
|
||||
// } else {
|
||||
// router.replace({ name: 'root' });
|
||||
// }
|
||||
// }
|
||||
// } catch (err) {
|
||||
// loading.value = false;
|
||||
// }
|
||||
// }
|
||||
// logins();
|
||||
}
|
||||
};
|
||||
const checkoutLogo = (): void => {
|
||||
|
Reference in New Issue
Block a user