@@ -15,6 +15,7 @@
<a-layout>
<a-layout-header style="background: #fff; padding: 0">
<a-icon
+ v-auth="['admin']"
class="trigger"
:type="collapsed ? 'menu-unfold' : 'menu-fold'"
@click="collapsed = !collapsed"
@@ -29,7 +30,9 @@
</a-layout-footer>
</a-layout>
- <SettingDrawer />
+ <Authorized :authority="['admin']">
+ <SettingDrawer />
+ </Authorized>
</div>
</template>
@@ -3,6 +3,8 @@ import App from "./App.vue";
import router from "./router";
import store from "./store";
import { Button, Layout, Icon, Drawer, Radio, Menu } from "ant-design-vue";
+import Authorized from "./components/Authorized";
+import Auth from "./directives/auth";
Vue.config.productionTip = false;
@@ -12,6 +14,8 @@ Vue.use(Icon);
Vue.use(Drawer);
Vue.use(Radio);
Vue.use(Menu);
+Vue.component("Authorized", Authorized);
+Vue.use(Auth);
new Vue({
router,