Files
wireguard-dashboard-admin/src/views/permission/page/index.vue

52 lines
1.2 KiB
Vue
Raw Normal View History

2021-12-14 10:51:07 +08:00
<script lang="ts">
export default {
name: "permissionPage"
};
</script>
2021-10-16 21:17:18 +08:00
<script setup lang="ts">
import { ref, unref } from "vue";
import { storageSession } from "/@/utils/storage";
2022-02-18 11:52:12 +08:00
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
2021-10-16 21:17:18 +08:00
let purview = ref<string>(storageSession.getItem("info").username);
2021-10-16 21:17:18 +08:00
function changRole() {
if (unref(purview) === "admin") {
storageSession.setItem("info", {
username: "test",
accessToken: "eyJhbGciOiJIUzUxMiJ9.test"
});
window.location.reload();
} else {
storageSession.setItem("info", {
username: "admin",
accessToken: "eyJhbGciOiJIUzUxMiJ9.admin"
});
window.location.reload();
}
}
</script>
<template>
2022-03-14 14:49:02 +08:00
<el-card>
<template #header>
<div class="card-header">
<span>
当前角色
<span style="font-size: 26px">{{ purview }}</span>
<p style="color: #ffa500">
查看左侧菜单变化(系统管理)模拟后台根据不同角色返回对应路由
</p></span
>
</div>
</template>
2022-02-18 11:52:12 +08:00
<el-button
type="primary"
@click="changRole"
:icon="useRenderIcon('user', { color: '#fff' })"
>切换角色</el-button
>
2022-03-14 14:49:02 +08:00
</el-card>
2021-10-16 21:17:18 +08:00
</template>