mirror of
https://github.com/hpd840321/craftlabs-authorization-sdk.git
synced 2026-06-09 18:10:30 +08:00
feat(web): VITE_API_BASE and I6 home module navigation
Made-with: Cursor
This commit is contained in:
@@ -1,10 +1,25 @@
|
||||
<template>
|
||||
<el-card>
|
||||
<el-alert title="I1:JWT + 布局壳;后续迭代挂载 M1~M11" type="info" show-icon :closable="false" />
|
||||
<p class="meta">用户:{{ auth.displayName }},角色:{{ auth.roles.join(", ") || "—" }}</p>
|
||||
<el-button type="primary" :loading="pingLoading" @click="ping">Bearer 调用 /api/v1/ping</el-button>
|
||||
<pre v-if="pingBody">{{ pingBody }}</pre>
|
||||
</el-card>
|
||||
<div class="home">
|
||||
<el-card class="block">
|
||||
<el-alert
|
||||
title="交付平台(I6 UAT):以下为已实现模块的快速入口;登录态为 JWT Bearer"
|
||||
type="info"
|
||||
show-icon
|
||||
:closable="false"
|
||||
/>
|
||||
<p class="meta">用户:{{ auth.displayName }},角色:{{ auth.roles.join(", ") || "—" }}</p>
|
||||
<div class="quick-links" aria-label="模块导航">
|
||||
<router-link v-for="l in moduleLinks" :key="l.to" class="ql" :to="l.to">
|
||||
{{ l.label }}
|
||||
</router-link>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="block">
|
||||
<template #header>调试</template>
|
||||
<el-button type="primary" :loading="pingLoading" @click="ping">Bearer 调用 /api/v1/ping</el-button>
|
||||
<pre v-if="pingBody">{{ pingBody }}</pre>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -16,6 +31,18 @@ const auth = useAuthStore();
|
||||
const pingBody = ref("");
|
||||
const pingLoading = ref(false);
|
||||
|
||||
/** I6:全链路导航锚点,与 MainLayout 菜单一致 */
|
||||
const moduleLinks = [
|
||||
{ to: "/customers", label: "客户" },
|
||||
{ to: "/projects", label: "项目" },
|
||||
{ to: "/contracts", label: "合同" },
|
||||
{ to: "/deliveries", label: "交付" },
|
||||
{ to: "/licenses/sn", label: "许可 SN" },
|
||||
{ to: "/callbacks", label: "Callback 收件箱" },
|
||||
{ to: "/integration/environments", label: "集成环境" },
|
||||
{ to: "/integration/product-lines", label: "产品线" },
|
||||
];
|
||||
|
||||
onMounted(() => auth.restoreAxiosAuth());
|
||||
|
||||
async function ping() {
|
||||
@@ -33,9 +60,27 @@ async function ping() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.home {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
.meta {
|
||||
margin: 12px 0;
|
||||
}
|
||||
.quick-links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px 14px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
.ql {
|
||||
color: var(--el-color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
.ql:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
pre {
|
||||
margin-top: 12px;
|
||||
background: #1e1e1e;
|
||||
|
||||
Reference in New Issue
Block a user