diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-07-19 00:04:09 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-07-19 00:04:09 +0900 |
| commit | efaa41ba49a887b3a94c0bdc169604547e49930a (patch) | |
| tree | f26f1185be6780b9abc2c0f853418498d4398f05 /src/client | |
| parent | Fix indent (diff) | |
| download | misskey-efaa41ba49a887b3a94c0bdc169604547e49930a.tar.gz misskey-efaa41ba49a887b3a94c0bdc169604547e49930a.tar.bz2 misskey-efaa41ba49a887b3a94c0bdc169604547e49930a.zip | |
reCAPTCHAをオプションに
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/common/views/components/signup.vue | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/client/app/common/views/components/signup.vue b/src/client/app/common/views/components/signup.vue index 62373a59ec..8b422268e8 100644 --- a/src/client/app/common/views/components/signup.vue +++ b/src/client/app/common/views/components/signup.vue @@ -29,7 +29,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 class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div> + <div v-if="recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div> <label class="agree-tou" style="display: block; margin: 16px 0;"> <input name="agree-tou" type="checkbox" required/> <p><a :href="touUrl" target="_blank">利用規約</a>に同意する</p> @@ -115,7 +115,7 @@ export default Vue.extend({ (this as any).api('signup', { username: this.username, password: this.password, - 'g-recaptcha-response': (window as any).grecaptcha.getResponse() + 'g-recaptcha-response': recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null }).then(() => { (this as any).api('signin', { username: this.username, @@ -126,15 +126,19 @@ export default Vue.extend({ }).catch(() => { alert('%i18n:@some-error%'); - (window as any).grecaptcha.reset(); + if (recaptchaSitekey != null) { + (window as any).grecaptcha.reset(); + } }); } }, 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); + 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> |