This commit is contained in:
Pig Fang 2019-03-27 11:09:11 +08:00
parent 64658fd9f2
commit a5d2659d98
8 changed files with 10 additions and 10 deletions

View File

@ -29,7 +29,7 @@
:title="$t('auth.change-captcha')" :title="$t('auth.change-captcha')"
data-placement="top" data-placement="top"
data-toggle="tooltip" data-toggle="tooltip"
@click="refreshCaptcha" @click="refresh"
> >
</div> </div>
</div> </div>
@ -71,7 +71,7 @@ export default {
onVerify(response) { onVerify(response) {
this.value = response this.value = response
}, },
refreshCaptcha() { refresh() {
if (this.recaptcha) { if (this.recaptcha) {
this.$refs.recaptcha.reset() this.$refs.recaptcha.reset()
} else { } else {

View File

@ -88,7 +88,7 @@ export default {
this.infoMsg = '' this.infoMsg = ''
this.warningMsg = msg this.warningMsg = msg
this.pending = false this.pending = false
this.$refs.captcha.refreshCaptcha() this.$refs.captcha.refresh()
} }
}, },
}, },

View File

@ -118,7 +118,7 @@ export default {
this.infoMsg = '' this.infoMsg = ''
this.warningMsg = msg this.warningMsg = msg
this.pending = false this.pending = false
this.$refs.captcha.refreshCaptcha() this.$refs.captcha.refresh()
} }
}, },
}, },

View File

@ -179,7 +179,7 @@ export default {
} else { } else {
this.infoMsg = '' this.infoMsg = ''
this.warningMsg = msg this.warningMsg = msg
this.$refs.captcha.refreshCaptcha() this.$refs.captcha.refresh()
this.pending = false this.pending = false
} }
}, },

View File

@ -17,8 +17,8 @@ test('display recaptcha', () => {
}) })
test('refresh recaptcha', () => { test('refresh recaptcha', () => {
const wrapper = mount<Vue & { refreshCaptcha(): void }>(Captcha) const wrapper = mount<Vue & { refresh(): void }>(Captcha)
wrapper.vm.refreshCaptcha() wrapper.vm.refresh()
}) })
test('recaptcha verified', () => { test('recaptcha verified', () => {

View File

@ -9,7 +9,7 @@ const Captcha = Vue.extend({
execute() { execute() {
return Promise.resolve('captcha') return Promise.resolve('captcha')
}, },
refreshCaptcha() { /* */ }, refresh() { /* */ },
}, },
}) })

View File

@ -7,7 +7,7 @@ const Captcha = Vue.extend({
execute() { execute() {
return Promise.resolve('a') return Promise.resolve('a')
}, },
refreshCaptcha() { /* */ }, refresh() { /* */ },
}, },
template: '<img>', template: '<img>',
}) })

View File

@ -10,7 +10,7 @@ const Captcha = Vue.extend({
execute() { execute() {
return Promise.resolve('captcha') return Promise.resolve('captcha')
}, },
refreshCaptcha() { /* */ }, refresh() { /* */ },
}, },
}) })