File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 126
126
"label" : " 時間割をつくる先生方" ,
127
127
"buttons" : {
128
128
"signup" : " ユーザー登録する" ,
129
- "login" : " ログインする"
129
+ "login" : " ログインする" ,
130
+ "registerLessons" : " 時間割をつくる" ,
131
+ "logout" : " ログアウトする"
130
132
}
131
133
}
132
134
},
Original file line number Diff line number Diff line change 39
39
</v-row >
40
40
<div style =" margin : 0 10px " >
41
41
<base-action-button
42
+ v-if =" isLoggedIn"
43
+ :text =" $t('pages.index.teachers.buttons.registerLessons')"
44
+ class =" registerButton"
45
+ @click =" $router.push('/user/classlist')"
46
+ />
47
+ <base-action-button
48
+ v-else
42
49
:text =" $t('pages.index.teachers.buttons.signup')"
43
50
class =" registerButton"
44
51
@click =" $router.push('/user/terms')"
45
52
/>
46
53
47
54
<base-action-button
55
+ v-if =" isLoggedIn"
56
+ :text =" $t('pages.index.teachers.buttons.logout')"
57
+ class =" loginButton"
58
+ theme =" secondary"
59
+ @click =" $router.push('/user/logout')"
60
+ />
61
+ <base-action-button
62
+ v-else
48
63
:text =" $t('pages.index.teachers.buttons.login')"
49
64
class =" loginButton"
50
65
theme =" secondary"
51
66
@click =" $router.push('/user/login')"
52
67
/>
68
+
53
69
<v-footer color =" #004170" padless >
54
70
<ul class =" Index-Footer-List" >
55
71
<li >
93
109
import Vue from ' vue'
94
110
import BaseInputField from ' @/components/BaseInputField.vue'
95
111
import BaseActionButton from ' @/components/BaseActionButton.vue'
96
- import { API } from ' aws-amplify'
112
+ import { API , Auth } from ' aws-amplify'
97
113
import { GRAPHQL_AUTH_MODE , GraphQLResult } from ' @aws-amplify/api'
98
114
import { getClass } from ' @/graphql/queries'
99
115
import { GetClassQuery } from ' @/API'
@@ -104,6 +120,7 @@ type DataType = {
104
120
loading: boolean
105
121
error: boolean
106
122
valid: boolean
123
+ isLoggedIn: boolean
107
124
}
108
125
109
126
export default Vue .extend ({
@@ -117,8 +134,13 @@ export default Vue.extend({
117
134
loading: false ,
118
135
error: false ,
119
136
valid: true ,
137
+ isLoggedIn: false ,
120
138
}
121
139
},
140
+ async mounted() {
141
+ const userInfo = await Auth .currentUserInfo ()
142
+ this .isLoggedIn = !! userInfo
143
+ },
122
144
methods: {
123
145
async loginToClass() {
124
146
this .loading = true
You can’t perform that action at this time.
0 commit comments