File tree Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import Mentions from '@/views/Mentions.vue'
1616import Messages from '@/views/Messages.vue'
1717import PostSearch from '@/views/PostSearch.vue'
1818import Join from '@/views/Join.vue'
19+ import GeneralSettings from '@/views/admin/GeneralSettings.vue'
1920import ConfirmAccount from '@/views/ConfirmAccount.vue'
2021import ResetPassword from '@/views/ResetPassword.vue'
2122import Profile from '@/views/Profile.vue'
@@ -30,6 +31,13 @@ import { localStorageAuth } from '@/composables/stores/auth'
3031import BanStore from '@/composables/stores/ban'
3132
3233const routes = [
34+ {
35+ path : '/admin/settings' ,
36+ alias : '/admin' ,
37+ name : 'GeneralSettings' ,
38+ component : GeneralSettings ,
39+ meta : { requiresAuth : true , bodyClass : 'general-settings' }
40+ } ,
3341 {
3442 path : '/' ,
3543 name : 'Boards' ,
@@ -216,8 +224,6 @@ router.beforeEach(to => {
216224 BanStore . initBanNotice ( localStorageAuth ( ) . data )
217225
218226 // Redirect to login page if route has meta.requiresAuth set
219- console . log ( to )
220-
221227 if ( to . meta . requiresAuth && ! localStorageAuth ( ) . data . token ) {
222228 router . push ( {
223229 name : 'Login' ,
Original file line number Diff line number Diff line change 1+ <template >
2+ <h1 >General Settings</h1 >
3+ <div class =" description" >Hello World</div >
4+ {{config}}
5+ </template >
6+
7+ <script >
8+ import { reactive , toRefs } from ' vue'
9+ import { adminApi } from ' @/api'
10+
11+ export default {
12+ name: ' GeneralSettings' ,
13+ beforeRouteEnter (to , from , next ) {
14+ adminApi .configurations ().then (data => next (vm => vm .config = data))
15+ },
16+ beforeRouteUpdate (to , from , next ) {
17+ adminApi .configurations ().then (data => {
18+ this .config = data
19+ next ()
20+ })
21+ },
22+ setup () {
23+ const v = reactive ({ config: {} })
24+ return { ... toRefs (v) }
25+ }
26+ }
27+ </script >
28+
29+ <style lang="scss">
30+ .general-settings {
31+ main #public-content {
32+ max-width : unset ;
33+ grid-template-areas : ' header header' ' main main' ' main main' ;
34+ }
35+ }
36+ </style >
You can’t perform that action at this time.
0 commit comments