|
@@ -5,12 +5,13 @@
|
|
|
<el-header class="box_shadow_card">
|
|
<el-header class="box_shadow_card">
|
|
|
<div class="header-content">
|
|
<div class="header-content">
|
|
|
<div class="logo" @click="$router.push('/')">{{ $t('common.title') }}</div>
|
|
<div class="logo" @click="$router.push('/')">{{ $t('common.title') }}</div>
|
|
|
- <el-menu :default-active="activeIndex" mode="horizontal" :ellipsis="false" class="meauList">
|
|
|
|
|
|
|
+ <el-menu :default-active="activeIndex"
|
|
|
|
|
+ mode="horizontal" :ellipsis="false" class="meauList">
|
|
|
<el-menu-item index="1" @click="$router.push('/')">AI {{ $t('common.gongzuoliu') }}</el-menu-item>
|
|
<el-menu-item index="1" @click="$router.push('/')">AI {{ $t('common.gongzuoliu') }}</el-menu-item>
|
|
|
<!-- <el-menu-item index="2" @click="$router.push('/my-learning')">工作流交易</el-menu-item> -->
|
|
<!-- <el-menu-item index="2" @click="$router.push('/my-learning')">工作流交易</el-menu-item> -->
|
|
|
<el-menu-item index="2" @click="goMyLearning">{{ $t('common.gongzuoliu_trade') }}</el-menu-item>
|
|
<el-menu-item index="2" @click="goMyLearning">{{ $t('common.gongzuoliu_trade') }}</el-menu-item>
|
|
|
<el-menu-item index="3" @click="$router.push('/learning-system')">{{ $t('route.learning_system') }}</el-menu-item>
|
|
<el-menu-item index="3" @click="$router.push('/learning-system')">{{ $t('route.learning_system') }}</el-menu-item>
|
|
|
- <el-menu-item index="4" @click="$router.push('/learn-note')">{{ $t('common.xuxibiji') }}</el-menu-item>
|
|
|
|
|
|
|
+ <el-menu-item index="4" @click=" goLearnNote">{{ $t('common.xuxibiji') }}</el-menu-item>
|
|
|
<el-menu-item index="5" @click="$router.push('/mibi-shop')">{{ $t('route.mibiShop') }}</el-menu-item>
|
|
<el-menu-item index="5" @click="$router.push('/mibi-shop')">{{ $t('route.mibiShop') }}</el-menu-item>
|
|
|
<!-- <el-menu-item index="5" @click="$router.push('/my-learning')">米币商城</el-menu-item> -->
|
|
<!-- <el-menu-item index="5" @click="$router.push('/my-learning')">米币商城</el-menu-item> -->
|
|
|
</el-menu>
|
|
</el-menu>
|
|
@@ -46,7 +47,7 @@
|
|
|
<el-footer>
|
|
<el-footer>
|
|
|
<div class="footer-content" >
|
|
<div class="footer-content" >
|
|
|
<p>
|
|
<p>
|
|
|
- <span class="cursor-pointer" @click="router.push({name:'Agreement',query:{type:'serviceAgreement'}})">{{ $t('agreement.serviceAgreement') }}</span>
|
|
|
|
|
|
|
+ <span class="cursor-pointer" @click="router.push({name:'Agreement',query:{type:'service_agreement'}})">{{ $t('agreement.service_agreement') }}</span>
|
|
|
<span class="gray999"> | </span>
|
|
<span class="gray999"> | </span>
|
|
|
<span class="cursor-pointer" @click="router.push({name:'Agreement',query:{type:'privacy_policy'}})">{{ $t('agreement.privacy_policy') }}</span>
|
|
<span class="cursor-pointer" @click="router.push({name:'Agreement',query:{type:'privacy_policy'}})">{{ $t('agreement.privacy_policy') }}</span>
|
|
|
<span class="gray999"> | </span>
|
|
<span class="gray999"> | </span>
|
|
@@ -66,11 +67,11 @@
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { logout } from '@/api/auth.js'
|
|
import { logout } from '@/api/auth.js'
|
|
|
import LoginDialog from './components/LoginDialog.vue'
|
|
import LoginDialog from './components/LoginDialog.vue'
|
|
|
-import { computed,ref,onMounted, provide, watch } from 'vue'
|
|
|
|
|
|
|
+import { computed,ref,onMounted, provide, watch, nextTick } from 'vue'
|
|
|
import LangSwitch from './components/LangSwitch.vue'
|
|
import LangSwitch from './components/LangSwitch.vue'
|
|
|
import { ElConfigProvider, ElMessage } from 'element-plus'
|
|
import { ElConfigProvider, ElMessage } from 'element-plus'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
-import { openNewTab } from '@/utils/util.js'
|
|
|
|
|
|
|
+import { openNewTab, isLogin } from '@/utils/util.js'
|
|
|
// 在Pinia安装后再设置初始语言
|
|
// 在Pinia安装后再设置初始语言
|
|
|
import { useLangStore } from '@/pinia/langStore'
|
|
import { useLangStore } from '@/pinia/langStore'
|
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
@@ -114,8 +115,21 @@ const handleLoginSuccess = () => {
|
|
|
function goMyLearning() {
|
|
function goMyLearning() {
|
|
|
router.push('/workflow-trade')
|
|
router.push('/workflow-trade')
|
|
|
};
|
|
};
|
|
|
|
|
+const goLearnNote = () => {
|
|
|
|
|
+ router.push('/learn-note');
|
|
|
|
|
+ if (!isLogin({ callback: openLoginDialog, t })) {
|
|
|
|
|
+ nextTick(()=>{
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ router.back();
|
|
|
|
|
+ },500)
|
|
|
|
|
+ })
|
|
|
|
|
+ return; // 如果未登录则不执行跳转,也不激活菜单
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
// 将 activeIndex 改为响应式,并根据当前路由动态计算
|
|
// 将 activeIndex 改为响应式,并根据当前路由动态计算
|
|
|
const activeIndex = computed(() => {
|
|
const activeIndex = computed(() => {
|
|
|
|
|
+ console.log('route.path',route.path)
|
|
|
if (route.path === '/') return '1'
|
|
if (route.path === '/') return '1'
|
|
|
if (route.path.startsWith('/workflow-trade')) {
|
|
if (route.path.startsWith('/workflow-trade')) {
|
|
|
return '2'
|
|
return '2'
|
|
@@ -124,7 +138,9 @@ const activeIndex = computed(() => {
|
|
|
return '3'
|
|
return '3'
|
|
|
}
|
|
}
|
|
|
if (route.path.startsWith('/learn-note')) {
|
|
if (route.path.startsWith('/learn-note')) {
|
|
|
- return '4'
|
|
|
|
|
|
|
+ // 如果用户未登录,不应该显示此菜单为激活状态
|
|
|
|
|
+ if (!appStore.token) return null; // 或者返回上一个有效菜单
|
|
|
|
|
+ return '4';
|
|
|
}
|
|
}
|
|
|
if (route.path.startsWith('/mibi-shop')) {
|
|
if (route.path.startsWith('/mibi-shop')) {
|
|
|
return '5'
|
|
return '5'
|