sql数据流,amdin业务逻辑接入
This commit is contained in:
@@ -59,6 +59,8 @@
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { ensureAnalyticsLogin } from '@/services/analytics/authGuard.uts'
|
||||
import { getCurrentUser } from '@/utils/store.uts'
|
||||
import AdminAside from '@/layouts/admin/components/AdminAside.uvue'
|
||||
import AdminSubSider from '@/layouts/admin/components/AdminSubSider.uvue'
|
||||
import AdminHeader from '@/layouts/admin/components/AdminHeader.uvue'
|
||||
@@ -192,7 +194,19 @@ function onNotify(): void {
|
||||
// 生命周期
|
||||
// ============================================
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
if (!ensureAnalyticsLogin({ toastTitle: '请先登录以访问管理后台' })) return
|
||||
|
||||
const profile = await getCurrentUser()
|
||||
const role = profile?.role
|
||||
if (!role || !['admin', 'analytics'].includes(role)) {
|
||||
uni.showToast({ title: '权限不足', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
uni.switchTab({ url: '/pages/mall/consumer/index' })
|
||||
}, 800)
|
||||
return
|
||||
}
|
||||
|
||||
initNavState()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -47,11 +47,13 @@ defineEmits<{
|
||||
display:flex;
|
||||
flex-direction:row;
|
||||
align-items:center;
|
||||
flex-wrap: nowrap;
|
||||
gap: 8px;
|
||||
padding: 0 12px;
|
||||
height: 44px;
|
||||
}
|
||||
.tag{
|
||||
flex: 0 0 auto;
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
border: 1px solid #e5e7eb;
|
||||
|
||||
Reference in New Issue
Block a user