|
@@ -3,6 +3,7 @@ import { useRouter } from 'vue-router'
|
|
|
import { useHeaderSearch } from '@/stores/modules/headerSearch'
|
|
import { useHeaderSearch } from '@/stores/modules/headerSearch'
|
|
|
import SlideVerify from './components/SlideVerify.vue'
|
|
import SlideVerify from './components/SlideVerify.vue'
|
|
|
import CryptoJS from 'crypto-js'
|
|
import CryptoJS from 'crypto-js'
|
|
|
|
|
+import dayjs from 'dayjs'
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
|
|
|
|
@@ -44,9 +45,7 @@ const handleSearchNo = () => {
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
const { data } = res
|
|
const { data } = res
|
|
|
- if (data.msg === 'visit limit') {
|
|
|
|
|
- slideVerifyRef.value?.openDialog()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
if (data.msg === 'No matches') {
|
|
if (data.msg === 'No matches') {
|
|
|
searchResult.value = 'error'
|
|
searchResult.value = 'error'
|
|
|
} else if (data.msg === 'Multiple results') {
|
|
} else if (data.msg === 'Multiple results') {
|
|
@@ -55,6 +54,11 @@ const handleSearchNo = () => {
|
|
|
sessionStorage.setItem('publicTrackingData', JSON.stringify(data.data))
|
|
sessionStorage.setItem('publicTrackingData', JSON.stringify(data.data))
|
|
|
router.push(`/public-tracking/detail?searchNo=${inputVModel.value}`)
|
|
router.push(`/public-tracking/detail?searchNo=${inputVModel.value}`)
|
|
|
}
|
|
}
|
|
|
|
|
+ } else if (res.code === 400) {
|
|
|
|
|
+ const { data } = res
|
|
|
|
|
+ if (data.msg === 'visit limit') {
|
|
|
|
|
+ slideVerifyRef.value?.openDialog()
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
.finally(() => {
|
|
.finally(() => {
|
|
@@ -65,13 +69,20 @@ const handleSearchNo = () => {
|
|
|
|
|
|
|
|
const slideVerifyRef = ref<InstanceType<typeof SlideVerify> | null>(null)
|
|
const slideVerifyRef = ref<InstanceType<typeof SlideVerify> | null>(null)
|
|
|
const secretKey = 'fT5!R1k$7Mv@4Q9X'
|
|
const secretKey = 'fT5!R1k$7Mv@4Q9X'
|
|
|
|
|
+const fixedIv = '1234567890123456' // 固定的初始化向量,长度为16字符
|
|
|
|
|
+
|
|
|
// AES 加密函数
|
|
// AES 加密函数
|
|
|
const encryptPassword = (password) => {
|
|
const encryptPassword = (password) => {
|
|
|
- return CryptoJS.AES.encrypt(password, secretKey).toString()
|
|
|
|
|
|
|
+ const key = CryptoJS.enc.Utf8.parse(secretKey) // 解析密钥
|
|
|
|
|
+ const iv = CryptoJS.enc.Utf8.parse(fixedIv) // 解析IV
|
|
|
|
|
+ const encrypted = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(password), key, { iv: iv })
|
|
|
|
|
+ return encrypted.toString()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 验证滑块成功
|
|
// 验证滑块成功
|
|
|
const confirmVerify = () => {
|
|
const confirmVerify = () => {
|
|
|
- confirmVerifyStatus.value = encryptPassword('completed')
|
|
|
|
|
|
|
+ const pwd = dayjs().unix()
|
|
|
|
|
+ confirmVerifyStatus.value = encryptPassword(pwd)
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|