|
|
@@ -24,11 +24,11 @@
|
|
|
</header>
|
|
|
<Login v-if="userStore.showLogin" @close="userStore.showLogin = false" class="fadeIn" />
|
|
|
<SwitchAccount v-if="userStore.showSwitchAccount" @close="userStore.showSwitchAccount = false" class="fadeIn" />
|
|
|
- <UpdatePwd v-if="userStore.showUpdatePwd" @close="userStore.showUpdatePwd = false" class="fadeIn" />
|
|
|
+ <UpdatePwd v-if="userStore.showUpdatePwd || firstLogin" @close="handleUpdatePwdClose" class="fadeIn" />
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
- import { ref, computed } from 'vue';
|
|
|
+ import { computed } from 'vue';
|
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
|
import UpdatePwd from '@/components/UpdatePwd.vue';
|
|
|
import UserInfo from '@/components/UserInfo.vue';
|
|
|
@@ -40,36 +40,49 @@
|
|
|
import { SYS_TENANT_ID } from '@/utils/useTargetTenantIdSetting';
|
|
|
import { NAV_LIST } from '@/constant/nav';
|
|
|
import logo from 'assets/images/home/comac-logo@1X.png';
|
|
|
- import searchIcon from 'assets/svg/search.svg';
|
|
|
+ import { ElMessage } from 'element-plus';
|
|
|
+ // import searchIcon from 'assets/svg/search.svg';
|
|
|
|
|
|
const userStore = useUserStore();
|
|
|
- const activeNav = ref(NAV_LIST[0].name);
|
|
|
+ const firstLogin = userStore.getUserInfo.isFirstLogin;
|
|
|
+ // const activeNav = ref(NAV_LIST[0].name);
|
|
|
const router = useRouter();
|
|
|
- const searchValue = ref('');
|
|
|
+ // const searchValue = ref('');
|
|
|
|
|
|
const props = withDefaults(defineProps<{ usePx?: boolean }>(), { usePx: false });
|
|
|
const usePx = computed(() => props.usePx === true);
|
|
|
|
|
|
- const handleSearch = () => {
|
|
|
- console.log('searchValue', searchValue.value);
|
|
|
- };
|
|
|
+ // const handleSearch = () => {
|
|
|
+ // console.log('searchValue', searchValue.value);
|
|
|
+ // };
|
|
|
|
|
|
const currentRoute = useRoute();
|
|
|
const { title } = useGlobSetting();
|
|
|
|
|
|
- const handleNavClick = (item: { name: string; path: string; isRedrect?: boolean }) => {
|
|
|
- if (item.isRedrect) {
|
|
|
+ const handleNavClick = (item: { name: string; path: string; meta?: any }) => {
|
|
|
+ if (item.meta?.isExternalLink) {
|
|
|
+ if (item.path === '403') {
|
|
|
+ router.replace(item.path);
|
|
|
+ return;
|
|
|
+ }
|
|
|
window.open(item.path, '_blank');
|
|
|
return;
|
|
|
}
|
|
|
- if (!item.path) {
|
|
|
- router.replace({ name: 'StayTune' });
|
|
|
- // ElMessage.warning({ message: `${item.name}功能建设中,暂无法访问`, offset: 100, grouping: true });
|
|
|
- return;
|
|
|
- }
|
|
|
router.push(item.path);
|
|
|
};
|
|
|
|
|
|
+ const handleUpdatePwdClose = () => {
|
|
|
+ if (firstLogin) {
|
|
|
+ ElMessage({
|
|
|
+ message: '首次登录请修改密码',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 3000,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ userStore.showUpdatePwd = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
const selectedKey = computed(() => {
|
|
|
return currentRoute.matched[0]?.name;
|
|
|
});
|