This commit is contained in:
parent
cb0e41c738
commit
0fe3f47207
@ -273,7 +273,10 @@
|
|||||||
<p class="dialog-tip">
|
<p class="dialog-tip">
|
||||||
为您的设备(例如“iPhone 自带邮件”、“公司 Foxmail”、“Mac Mail”)创建独立授权码:
|
为您的设备(例如“iPhone 自带邮件”、“公司 Foxmail”、“Mac Mail”)创建独立授权码:
|
||||||
</p>
|
</p>
|
||||||
<el-form @submit.prevent="submitCreateClient">
|
<el-form
|
||||||
|
id="client-credential-create-form"
|
||||||
|
@submit.prevent="submitCreateClient"
|
||||||
|
>
|
||||||
<el-form-item label="客户端名称">
|
<el-form-item label="客户端名称">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="newClientName"
|
v-model="newClientName"
|
||||||
@ -304,7 +307,8 @@
|
|||||||
class="btn-primary-action"
|
class="btn-primary-action"
|
||||||
:loading="createLoading"
|
:loading="createLoading"
|
||||||
:disabled="!newClientName.trim() || !createPassword || createLoading"
|
:disabled="!newClientName.trim() || !createPassword || createLoading"
|
||||||
@click="submitCreateClient"
|
native-type="submit"
|
||||||
|
form="client-credential-create-form"
|
||||||
>
|
>
|
||||||
验证并生成
|
验证并生成
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|||||||
@ -46,3 +46,12 @@ test('客户端凭据操作验证本人密码且保留密码空白字符', () =>
|
|||||||
assert.match(source, /if \(verifyLoading\.value\) return/)
|
assert.match(source, /if \(verifyLoading\.value\) return/)
|
||||||
assert.match(source, /finally \{\s+verifyPassword\.value = ''/)
|
assert.match(source, /finally \{\s+verifyPassword\.value = ''/)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('新增客户端使用原生表单提交且保留防重复提交保护', () => {
|
||||||
|
const source = read('js')
|
||||||
|
const template = read('vue')
|
||||||
|
assert.match(template, /<el-form\s+id="client-credential-create-form"\s+@submit\.prevent="submitCreateClient"/)
|
||||||
|
assert.match(template, /native-type="submit"\s+form="client-credential-create-form"/)
|
||||||
|
assert.doesNotMatch(template, /@click="submitCreateClient"|@key(?:down|up)\.enter[^=]*="submitCreateClient"/)
|
||||||
|
assert.match(source, /const submitCreateClient = async \(\) => \{\s+if \(createLoading\.value\) return/)
|
||||||
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user