提交 b0ff1c59 authored 作者: matian's avatar matian

修改接口请求字段

上级 34a3498d
import httpRequest from '@/utils/axios'
// 查询证书
export function getCard(params: { personal_name: string; id_number: string; certificate_number: string }) {
export function getCard(params: { personal_name: string; telephone: string; certificate_number: string }) {
return httpRequest.get('https://learn-api.ezijing.com/api/lms-financial/v1/education/search-certificate', { params })
}
// 发送验证码
......
......@@ -7,7 +7,7 @@ const $router = useRouter()
const form = reactive({
name: '', // 姓名
idNumber: '', // 身份证号
telephone: '', // 身份证号
cardNumber: '' // 证书编号
})
const queryResultList = reactive({ list: [] as any[] })
......@@ -15,7 +15,7 @@ const queryResultList = reactive({ list: [] as any[] })
const handleSubmit = () => {
const params = {
personal_name: form.name, // 姓名
id_number: form.idNumber, // 身份证号
telephone: form.telephone, // 身份证号
certificate_number: form.cardNumber // 证书编号
}
api.getCard(params).then((res: any) => {
......@@ -52,7 +52,7 @@ const handleSubmit = () => {
</el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.idNumber" placeholder="手机号码">
<el-input v-model="form.telephone" placeholder="手机号码">
<template #prefix>
<el-icon class="el-input_icon_id"></el-icon>
</template>
......
......@@ -40,10 +40,10 @@ httpRequest.interceptors.response.use(
location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
return Promise.reject(data)
}
// if (data.code === 1) {
// ElMessage.error(data.message || data.msg)
// return Promise.reject(data)
// }
if (data.code === 1 || data.code === 2) {
ElMessage.error(data.message || data.msg)
return Promise.reject(data)
}
return data
},
function (error) {
......@@ -54,7 +54,6 @@ httpRequest.interceptors.response.use(
location.href = `${import.meta.env.VITE_LOGIN_URL}?rd=${encodeURIComponent(location.href)}`
} else {
ElMessage.error(message)
console.error(`${status}: ${message}`)
}
} else {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论