add url protocol &

add web client on/off by api server
This commit is contained in:
ljw
2024-10-14 10:34:40 +08:00
parent 182f383d70
commit 3cc460ac8b
11 changed files with 88 additions and 23 deletions
@@ -50,6 +50,7 @@
import { shareByWebClient } from '@/api/address_book'
import { CopyDocument } from '@element-plus/icons'
import { handleClipboard } from '@/utils/clipboard'
import { ElMessageBox } from 'element-plus'
const props = defineProps({
id: String,
@@ -71,7 +72,7 @@
formData.id = props.id
formData.hash = props.hash
formData.password = ''
formData.expire = 300
formData.expire = 1800
formData.password_type = 'once'
link.value = ''
}
@@ -106,7 +107,10 @@
loading.value = true
const _formData = { ...formData }
if (formData.password !== formData.hash) {
const res = await getPeerSlat(formData.id).catch(_ => false)
const res = await getPeerSlat(formData.id).catch(e => {
ElMessageBox.alert(T('Timeout'), T('Error'))
return false
})
if (!res) {
loading.value = false
return