fix: 表单简单校验
parent
c56235dd30
commit
561f59073c
12
src/App.vue
12
src/App.vue
|
@ -9,6 +9,12 @@ const email = ref('')
|
|||
|
||||
async function genPrivateKey() {
|
||||
try {
|
||||
if (!merchantId.value) {
|
||||
return message('Please enter your merchant id', 'PHIZ - Tips')
|
||||
}
|
||||
if (!email.value) {
|
||||
return message('Please enter your email', 'PHIZ - Tips')
|
||||
}
|
||||
const savePath = await open({
|
||||
title: 'Select a directory to save',
|
||||
defaultPath: await downloadDir(),
|
||||
|
@ -16,12 +22,12 @@ async function genPrivateKey() {
|
|||
recursive: true
|
||||
})
|
||||
if (!savePath) {
|
||||
return message('Please select a directory to save')
|
||||
return message('Please select a directory to save', 'PHIZ - Tips')
|
||||
}
|
||||
await invoke('gen_rsa_pair', { merchantId: merchantId.value, email: email.value, savePath })
|
||||
message('Successfully generated', 'Success')
|
||||
message('Successfully generated', 'PHIZ - Success')
|
||||
} catch {
|
||||
message('Generation failed', 'Error')
|
||||
message('Generation failed', 'PHIZ - Error')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue