feat(auth): 优化登录页面并添加国家代码支持
- 添加国家代码数据导入,实现根据不同语言设置默认国家 - 新增国家选择功能,用于注册和登录页面 - 在签名面板中添加拍卖艺术品 UUID 传递
This commit is contained in:
parent
cc8091d04e
commit
ead04355d0
@ -7,7 +7,7 @@ import {message} from '@/components/x-message/useMessage.js'
|
|||||||
// ... 现有导入 ...
|
// ... 现有导入 ...
|
||||||
import FingerprintJS from '@fingerprintjs/fingerprintjs'
|
import FingerprintJS from '@fingerprintjs/fingerprintjs'
|
||||||
import {checkPhone, mobileLogin, userSend} from "@/api-collect-code/auth/index.js";
|
import {checkPhone, mobileLogin, userSend} from "@/api-collect-code/auth/index.js";
|
||||||
|
import countryCode from '@/pages/countryRegion/data/index.js'
|
||||||
const {userInfo, codeToken, fingerprint} = codeAuthStore()
|
const {userInfo, codeToken, fingerprint} = codeAuthStore()
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
@ -103,6 +103,40 @@ const showPassword = ref(false)
|
|||||||
const togglePasswordVisibility = () => {
|
const togglePasswordVisibility = () => {
|
||||||
showPassword.value = !showPassword.value
|
showPassword.value = !showPassword.value
|
||||||
}
|
}
|
||||||
|
const getDefaultCountry = () => {
|
||||||
|
let defaultCode = 'CN' // 默认中国大陆
|
||||||
|
switch (locale.value) {
|
||||||
|
case 'zh-CN':
|
||||||
|
defaultCode = 'CN'
|
||||||
|
break
|
||||||
|
case 'zh-TW':
|
||||||
|
defaultCode = 'TW'
|
||||||
|
break
|
||||||
|
case 'ja-JP':
|
||||||
|
defaultCode = 'JP'
|
||||||
|
break
|
||||||
|
case 'en-US':
|
||||||
|
defaultCode = 'US'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
const country = countryCode.find(c => c.code === defaultCode)
|
||||||
|
return {
|
||||||
|
zone: country.zone,
|
||||||
|
name: locale.value === 'zh-CN' ? country.cn :
|
||||||
|
locale.value === 'zh-TW' ? country.tw :
|
||||||
|
locale.value === 'ja-JP' ? country.ja :
|
||||||
|
country.en
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const defaultCountry = getDefaultCountry()
|
||||||
|
|
||||||
|
const selectedCountry = ref('')
|
||||||
|
|
||||||
|
// onMounted(()=>{
|
||||||
|
// selectedZone.value=route.query.zone || defaultCountry.zone
|
||||||
|
// selectedCountry.value=route.query.countryName || defaultCountry.name
|
||||||
|
// })
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -5,7 +5,7 @@ import {codeAuthStore} from "~/stores-collect-code/auth/index.js";
|
|||||||
import {signOffline} from "~/api/goods/index.js";
|
import {signOffline} from "~/api/goods/index.js";
|
||||||
import {useI18n} from "vue-i18n";
|
import {useI18n} from "vue-i18n";
|
||||||
const {t} = useI18n();
|
const {t} = useI18n();
|
||||||
const {formData,number}=codeAuthStore()
|
const {formData,number,qrData}=codeAuthStore()
|
||||||
const signaturePad = ref(null);
|
const signaturePad = ref(null);
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: ''
|
layout: ''
|
||||||
@ -32,6 +32,7 @@ const clearSignature = () => {
|
|||||||
|
|
||||||
const confirm=async ()=>{
|
const confirm=async ()=>{
|
||||||
const res=await signOffline({
|
const res=await signOffline({
|
||||||
|
auctionArtworkUuid:qrData.value.auctionArtworkUuid,
|
||||||
userInfo:formData.value,
|
userInfo:formData.value,
|
||||||
signOrder:Number(number.value),
|
signOrder:Number(number.value),
|
||||||
signImgFileData:imgUrl.value,
|
signImgFileData:imgUrl.value,
|
||||||
|
Loading…
Reference in New Issue
Block a user