diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2018-08-19 22:32:58 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-19 22:32:58 +0900 |
| commit | 208dec25d937397d1933ebf95485b1261ae1e583 (patch) | |
| tree | a7cdeed42e56cc620cc8d748ef3a3bd2b0349737 /src/client/app/common | |
| parent | Merge pull request #2348 from mei23/mei-0819-nsfw3 (diff) | |
| parent | wip (diff) | |
| download | misskey-208dec25d937397d1933ebf95485b1261ae1e583.tar.gz misskey-208dec25d937397d1933ebf95485b1261ae1e583.tar.bz2 misskey-208dec25d937397d1933ebf95485b1261ae1e583.zip | |
Merge pull request #2349 from syuilo/configress-build
設定ファイルなしでビルドできるように
Diffstat (limited to 'src/client/app/common')
| -rw-r--r-- | src/client/app/common/views/components/signin.vue | 4 | ||||
| -rw-r--r-- | src/client/app/common/views/components/signup.vue | 23 |
2 files changed, 12 insertions, 15 deletions
diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue index 0c3cceb1b3..cf3e5c8ac1 100644 --- a/src/client/app/common/views/components/signin.vue +++ b/src/client/app/common/views/components/signin.vue @@ -12,13 +12,13 @@ </ui-input> <ui-input v-if="user && user.twoFactorEnabled" v-model="token" type="number" required/> <ui-button type="submit" :disabled="signing">{{ signing ? '%i18n:@signing-in%' : '%i18n:@signin%' }}</ui-button> - <p style="margin: 8px 0;" v-if="twitterIntegration">%i18n:@or% <a :href="`${apiUrl}/signin/twitter`">%i18n:@signin-with-twitter%</a></p> + <p style="margin: 8px 0;">%i18n:@or% <a :href="`${apiUrl}/signin/twitter`">%i18n:@signin-with-twitter%</a></p> </form> </template> <script lang="ts"> import Vue from 'vue'; -import { apiUrl, host, twitterIntegration } from '../../../config'; +import { apiUrl, host } from '../../../config'; export default Vue.extend({ props: { diff --git a/src/client/app/common/views/components/signup.vue b/src/client/app/common/views/components/signup.vue index 1d33702159..810b850831 100644 --- a/src/client/app/common/views/components/signup.vue +++ b/src/client/app/common/views/components/signup.vue @@ -34,7 +34,7 @@ <p slot="text" v-if="passwordRetypeState == 'not-match'" style="color:#FF1161">%fa:exclamation-triangle .fw% %i18n:@password-not-matched%</p> </div> </ui-input> - <div v-if="recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div> + <div v-if="meta && meta.recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="meta.recaptchaSitekey" style="margin: 16px 0;"></div> <ui-button type="submit">%i18n:@create%</ui-button> </form> </template> @@ -42,7 +42,7 @@ <script lang="ts"> import Vue from 'vue'; const getPasswordStrength = require('syuilo-password-strength'); -import { host, url, recaptchaSitekey } from '../../../config'; +import { host, url } from '../../../config'; export default Vue.extend({ data() { @@ -53,7 +53,6 @@ export default Vue.extend({ retypedPassword: '', invitationCode: '', url, - recaptchaSitekey, usernameState: null, passwordStrength: '', passwordRetypeState: null, @@ -73,6 +72,12 @@ export default Vue.extend({ this.meta = meta; }); }, + mounted() { + const head = document.getElementsByTagName('head')[0]; + const script = document.createElement('script'); + script.setAttribute('src', 'https://www.google.com/recaptcha/api.js'); + head.appendChild(script); + }, methods: { onChangeUsername() { if (this.username == '') { @@ -123,7 +128,7 @@ export default Vue.extend({ username: this.username, password: this.password, invitationCode: this.invitationCode, - 'g-recaptcha-response': recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null + 'g-recaptcha-response': this.meta.recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null }).then(() => { (this as any).api('signin', { username: this.username, @@ -134,19 +139,11 @@ export default Vue.extend({ }).catch(() => { alert('%i18n:@some-error%'); - if (recaptchaSitekey != null) { + if (this.meta.recaptchaSitekey != null) { (window as any).grecaptcha.reset(); } }); } - }, - mounted() { - if (recaptchaSitekey != null) { - const head = document.getElementsByTagName('head')[0]; - const script = document.createElement('script'); - script.setAttribute('src', 'https://www.google.com/recaptcha/api.js'); - head.appendChild(script); - } } }); </script> |