mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-24 03:43:43 +08:00
重构角色和权限相关DTO,替换RoleDto为RoleRespDto,并更新相关服务和控制器逻辑
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
import { getUserAvatarUrl } from "@/utils/avatarUtil";
|
||||
import { computed } from "vue";
|
||||
|
||||
const {
|
||||
src = "",
|
||||
alt = "用户头像",
|
||||
size = "md"
|
||||
const {
|
||||
src = "",
|
||||
alt = "用户头像",
|
||||
size = "md",
|
||||
} = defineProps<{
|
||||
src?: string;
|
||||
alt?: string;
|
||||
@@ -37,7 +37,7 @@ const processedSrc = computed(() => {
|
||||
}
|
||||
if (src === "/trump.jpg") {
|
||||
return src;
|
||||
}
|
||||
}
|
||||
return getUserAvatarUrl(src);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<nav class="flex mb-4" aria-label="Breadcrumb">
|
||||
<ol class="inline-flex items-center space-x-1 sm:space-x-2 text-sm">
|
||||
<li class="inline-flex items-center">
|
||||
<RouterLink :to="{ name: RouteName.HOME }"
|
||||
<RouterLink :to="Routes.HOME.fullPath()"
|
||||
class="inline-flex items-center font-medium text-gray-500 hover:text-blue-600">
|
||||
<svg class="w-3.5 h-3.5 mr-1.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
||||
viewBox="0 0 20 20">
|
||||
@@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RouteName } from "@/router/constants";
|
||||
import { Routes } from "@/router/constants";
|
||||
import { computed } from "vue";
|
||||
import type { RouteLocationRaw } from "vue-router";
|
||||
|
||||
|
||||
@@ -53,14 +53,14 @@
|
||||
<li>
|
||||
<button @click="() => {
|
||||
userDropDownMenu?.toggle()
|
||||
router.push(`${RoutePath.DASHBOARD}/${RoutePath.SETTINGS}`)
|
||||
router.push(Routes.SETTINGS.fullPath())
|
||||
}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 "
|
||||
role="menuitem">Settings</button>
|
||||
</li>
|
||||
<li>
|
||||
<button @click="() => {
|
||||
userDropDownMenu?.toggle()
|
||||
router.push(RouteName.USERVIEW)
|
||||
router.push(Routes.USERVIEW.withParams({}))
|
||||
}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 "
|
||||
role="menuitem">Dashboard</button>
|
||||
</li>
|
||||
@@ -93,7 +93,7 @@ import { Dropdown, type DropdownInterface, initFlowbite } from "flowbite";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import useUserAuth from "../composables/auth/useUserAuth";
|
||||
import { RouteName, RoutePath } from "../router/constants";
|
||||
import { Routes } from "../router/constants";
|
||||
import Avatar from "./Avatar.vue";
|
||||
import AiChatIcon from "./icons/AiChatIcon.vue";
|
||||
|
||||
@@ -113,7 +113,7 @@ const { signOut } = useUserAuth();
|
||||
const router = useRouter();
|
||||
const handleLogoutClick = () => {
|
||||
signOut();
|
||||
router.push(RoutePath.LOGIN);
|
||||
router.push(Routes.LOGIN.path);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -52,7 +52,7 @@ import type { components } from "../api/types/schema";
|
||||
const alertStore = useAlertStore();
|
||||
|
||||
const { role, onSubmit } = defineProps<{
|
||||
role?: components["schemas"]["RoleDto"];
|
||||
role?: components["schemas"]["RoleRespDto"];
|
||||
closeModal: () => void;
|
||||
onSubmit: (data: RoleUpsertModel) => Promise<void>;
|
||||
}>();
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RoutePath } from "@/router/constants";
|
||||
import { Routes } from "@/router/constants";
|
||||
import { initFlowbite } from "flowbite";
|
||||
import { onMounted, ref } from "vue";
|
||||
import { RouterLink, useRoute } from "vue-router";
|
||||
@@ -73,42 +73,42 @@ defineExpose({
|
||||
const menuItems = [
|
||||
{
|
||||
title: "用户管理",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.USERVIEW}`,
|
||||
path: Routes.USERVIEW.fullPath(),
|
||||
icon: UsersIcon,
|
||||
},
|
||||
{
|
||||
title: "角色管理",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.ROLEVIEW}`,
|
||||
path: Routes.ROLEVIEW.fullPath(),
|
||||
icon: RoleIcon,
|
||||
},
|
||||
{
|
||||
title: "权限管理",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.PERMISSIONVIEW}`,
|
||||
path: Routes.PERMISSIONVIEW.fullPath(),
|
||||
icon: PermissionIcon,
|
||||
},
|
||||
{
|
||||
title: "部门管理",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.DEPARTMENTVIEW}`,
|
||||
path: Routes.DEPARTMENTVIEW.fullPath(),
|
||||
icon: DepartmentIcon,
|
||||
},
|
||||
{
|
||||
title: "岗位管理",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.POSITIONVIEW}`,
|
||||
path: Routes.POSITIONVIEW.fullPath(),
|
||||
icon: PositionIcon,
|
||||
},
|
||||
{
|
||||
title: "个人中心",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.SETTINGS}`,
|
||||
path: Routes.SETTINGS.fullPath(),
|
||||
icon: SettingsIcon,
|
||||
},
|
||||
{
|
||||
title: "定时任务",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.SCHEDULERVIEW}`,
|
||||
path: Routes.SCHEDULERVIEW.fullPath(),
|
||||
icon: SchedulerIcon,
|
||||
},
|
||||
{
|
||||
title: "大模型管理",
|
||||
path: `${RoutePath.DASHBOARD}/${RoutePath.LLMCONFIGVIEW}`,
|
||||
path: Routes.LLMCONFIGVIEW.fullPath(),
|
||||
icon: LlmConfigIcon,
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user