|
|
|
@ -2,20 +2,34 @@ |
|
|
|
|
<div :class="!flog && false ? 'tabbar' : 'tabbar-active'"> |
|
|
|
|
<div class="container"> |
|
|
|
|
<div class="logo-box"> |
|
|
|
|
<div class="logo"><img :src="adminInfoStore.info.logo"></div> |
|
|
|
|
<div class="logo"><img :src="adminInfoStore.info.logo" /></div> |
|
|
|
|
<div class="lesson">课图</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="menu"> |
|
|
|
|
<ul> |
|
|
|
|
<li v-for="(item, index) in constRouter[0].children" :class="{ active: settingStore.useIndex === index }" |
|
|
|
|
v-show="!item.meta.hidden" @click="goToRouter(item, index)" :key="item.path"> |
|
|
|
|
<li |
|
|
|
|
v-for="(item, index) in constRouter[0].children" |
|
|
|
|
:class="{ active: settingStore.useIndex === index }" |
|
|
|
|
v-show="!item.meta.hidden" |
|
|
|
|
@click="goToRouter(item, index)" |
|
|
|
|
:key="item.path" |
|
|
|
|
> |
|
|
|
|
<div>{{ item.meta.title }}</div> |
|
|
|
|
</li> |
|
|
|
|
<div v-if="isLogin"> |
|
|
|
|
<img :src="data.icon" alt="" style="width: 24px; height: 24px; margin: 0 10px; border-radius: 50%" /> |
|
|
|
|
<img |
|
|
|
|
:src="data.icon" |
|
|
|
|
alt="" |
|
|
|
|
style=" |
|
|
|
|
width: 24px; |
|
|
|
|
height: 24px; |
|
|
|
|
margin: 0 10px; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
" |
|
|
|
|
/> |
|
|
|
|
<el-dropdown @command="handleCommand"> |
|
|
|
|
<span class="el-dropdown-link" style="color: #fff;"> |
|
|
|
|
<span class="el-dropdown-link" style="color: #fff"> |
|
|
|
|
{{ data.username }} |
|
|
|
|
<el-icon class="el-icon--right"> |
|
|
|
|
<arrow-down /> |
|
|
|
@ -28,7 +42,7 @@ |
|
|
|
|
</template> |
|
|
|
|
</el-dropdown> |
|
|
|
|
</div> |
|
|
|
|
<li v-else @click="skip('http://localhost:8888/')">登录注册</li> |
|
|
|
|
<li v-else @click="skip">登录注册</li> |
|
|
|
|
<!-- <li v-if="$route.path != '/home'" @click="$router.push('/')">回到首页</li> --> |
|
|
|
|
</ul> |
|
|
|
|
<div class="entry"> |
|
|
|
@ -45,8 +59,8 @@ |
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
import useAdminInfoStore from '@/store/module/adminInfo' |
|
|
|
|
const adminInfoStore = useAdminInfoStore() |
|
|
|
|
import { userGetInfoService } from '@/api/configuration'; |
|
|
|
|
import useUserStore from '@/store/module/user'; |
|
|
|
|
import { userGetInfoService } from '@/api/configuration' |
|
|
|
|
import useUserStore from '@/store/module/user' |
|
|
|
|
const userStore = useUserStore() |
|
|
|
|
import { constRouter } from '@/router/module/constRouter' |
|
|
|
|
import { useRouter, useRoute } from 'vue-router' |
|
|
|
@ -57,7 +71,7 @@ const $route = useRoute() |
|
|
|
|
|
|
|
|
|
const settingStore = useSettingStore() |
|
|
|
|
const goToRouter = (item: any, index: number) => { |
|
|
|
|
console.log($route); |
|
|
|
|
console.log($route) |
|
|
|
|
|
|
|
|
|
settingStore.setuseIndex(index) |
|
|
|
|
$router.push({ path: `${item.path}` }) |
|
|
|
@ -74,19 +88,18 @@ onMounted(() => { |
|
|
|
|
}) |
|
|
|
|
const isLogin = ref(false) |
|
|
|
|
const data = ref<any>({}) |
|
|
|
|
userGetInfoService(userStore.token).then(res => { |
|
|
|
|
userGetInfoService(userStore.token).then((res) => { |
|
|
|
|
// @ts-ignore |
|
|
|
|
if (res.code === 200) { |
|
|
|
|
isLogin.value = true |
|
|
|
|
data.value = res.data |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
function skip(url: string) { |
|
|
|
|
function skip() { |
|
|
|
|
// location.replace(url) |
|
|
|
|
window.open(url) |
|
|
|
|
window.open(import.meta.env.VITE_ADMIN_URL) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 退出登录 |
|
|
|
|
function logout() { |
|
|
|
|
isLogin.value = false |
|
|
|
|