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