mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-12-16 15:20:36 +08:00
perf: update
This commit is contained in:
25
src/views/permission/button/index.vue
Normal file
25
src/views/permission/button/index.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { storageSession } from "/@/utils/storage";
|
||||
|
||||
const auth = ref<boolean>(storageSession.getItem("info").username || "admin");
|
||||
|
||||
function changRole(value) {
|
||||
storageSession.setItem("info", {
|
||||
username: value,
|
||||
accessToken: `eyJhbGciOiJIUzUxMiJ9.${value}`
|
||||
});
|
||||
window.location.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-radio-group v-model="auth" @change="changRole">
|
||||
<el-radio-button label="admin"></el-radio-button>
|
||||
<el-radio-button label="test"></el-radio-button>
|
||||
</el-radio-group>
|
||||
<p v-auth="'v-admin'">只有admin可看</p>
|
||||
<p v-auth="'v-test'">只有test可看</p>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user