File tree 2 files changed +44
-2
lines changed
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'
16
16
import Messages from '@/views/Messages.vue'
17
17
import PostSearch from '@/views/PostSearch.vue'
18
18
import Join from '@/views/Join.vue'
19
+ import GeneralSettings from '@/views/admin/GeneralSettings.vue'
19
20
import ConfirmAccount from '@/views/ConfirmAccount.vue'
20
21
import ResetPassword from '@/views/ResetPassword.vue'
21
22
import Profile from '@/views/Profile.vue'
@@ -30,6 +31,13 @@ import { localStorageAuth } from '@/composables/stores/auth'
30
31
import BanStore from '@/composables/stores/ban'
31
32
32
33
const routes = [
34
+ {
35
+ path : '/admin/settings' ,
36
+ alias : '/admin' ,
37
+ name : 'GeneralSettings' ,
38
+ component : GeneralSettings ,
39
+ meta : { requiresAuth : true , bodyClass : 'general-settings' }
40
+ } ,
33
41
{
34
42
path : '/' ,
35
43
name : 'Boards' ,
@@ -216,8 +224,6 @@ router.beforeEach(to => {
216
224
BanStore . initBanNotice ( localStorageAuth ( ) . data )
217
225
218
226
// Redirect to login page if route has meta.requiresAuth set
219
- console . log ( to )
220
-
221
227
if ( to . meta . requiresAuth && ! localStorageAuth ( ) . data . token ) {
222
228
router . push ( {
223
229
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