短信和ORC接口变更
This commit is contained in:
parent
dfbd252ed1
commit
6186c7723c
@ -167,24 +167,6 @@ export const appuserAthleteUpdatePut = (data) => {
|
||||
return http.post('/appuser/member/save', { ...data, personType: 1 });
|
||||
};
|
||||
|
||||
/**
|
||||
* 识别身份证信息
|
||||
* @param {Object} data - OCR请求
|
||||
* @param {string} data.imageUrl - 身份证图片URL
|
||||
*/
|
||||
export const appuserAthleteOcrPost = (data) => {
|
||||
return http.post('/appuser/member/recognize/idcard', { imageUrl: data});
|
||||
};
|
||||
|
||||
/**
|
||||
* 识别护照信息
|
||||
* @param {Object} data - OCR请求
|
||||
* @param {string} data.imageUrl - 护照图片URL
|
||||
*/
|
||||
export const appuserAthletePassportOcrPost = (data) => {
|
||||
return http.post('/appuser/member/recognize/passport', { imageUrl: data});
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除运动员
|
||||
* @param {Array<number>} data - 运动员ID数组
|
||||
|
||||
30
src/api/match/common.js
Normal file
30
src/api/match/common.js
Normal file
@ -0,0 +1,30 @@
|
||||
import { http } from '../../utils/request';
|
||||
|
||||
// ==================== 通用服务 ====================
|
||||
|
||||
/**
|
||||
* OCR识别身份证
|
||||
* @param {Object} data - OCR请求
|
||||
* @param {string} data.imageUrl - 图片URL
|
||||
*/
|
||||
export const commonOcrRecognizeIdcardPost = (data) => {
|
||||
return http.post('/ocr/recognize/idcard', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* OCR识别护照
|
||||
* @param {Object} data - OCR请求
|
||||
* @param {string} data.imageUrl - 图片URL
|
||||
*/
|
||||
export const commonOcrRecognizePassportPost = (data) => {
|
||||
return http.post('/ocr/recognize/passport', data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
* @param {Object} data - 验证码请求
|
||||
* @param {string} data.phone - 手机号
|
||||
*/
|
||||
export const commonSmsSendVerificationCodePost = (data) => {
|
||||
return http.post('/sms/sendVerificationCode', data);
|
||||
};
|
||||
@ -2,15 +2,6 @@ import { http } from '../../utils/request';
|
||||
|
||||
// ==================== 单位认证管理 ====================
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param {Object} params - 查询参数
|
||||
* @param {string} params.phone - 手机号码
|
||||
*/
|
||||
export const merchantcertificationSendVerificationCodePost = (params) => {
|
||||
return http.post('/merchantcertification/sendVerificationCode', null, { params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 提交单位认证
|
||||
* @param {Object} data - 认证信息
|
||||
|
||||
@ -52,7 +52,8 @@
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted, computed } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { merchantcertificationMyCertificationGet, merchantcertificationSubmitCertificationPost, merchantcertificationSendVerificationCodePost } from '/@/api/match/merchantcertification';
|
||||
import { merchantcertificationMyCertificationGet, merchantcertificationSubmitCertificationPost } from '/@/api/match/merchantcertification';
|
||||
import { commonSmsSendVerificationCodePost } from '/@/api/match/common';
|
||||
|
||||
const formRef = ref(null);
|
||||
|
||||
@ -137,7 +138,7 @@ const onSendCode = async () => {
|
||||
sending.value = true;
|
||||
sendTimer.value = 60;
|
||||
try {
|
||||
const res = await merchantcertificationSendVerificationCodePost({ phone: formData.contactPhone });
|
||||
const res = await commonSmsSendVerificationCodePost({ phone: formData.contactPhone });
|
||||
if (!res.succeeded) return
|
||||
ElMessage.success('验证码已发送');
|
||||
sendInterval.value = setInterval(() => {
|
||||
|
||||
@ -187,7 +187,8 @@ import SysMenuApi from '/@/api/SysMenuApi';
|
||||
import { auths } from '/@/utils/authFunction';
|
||||
import ProTable from '/@/components/ProTable/index.vue';
|
||||
import { teamPageGet, teamDetailGet, teamAddPost, teamDeleteDelete, teamUpdatePut } from '/@/api/match/unitUser';
|
||||
import { appuserAthletePageGet, appuserAthleteAddPost, appuserAthleteUpdatePut, appuserAthleteOcrPost, appuserLeaderPageGet, appuserCoachPageGet ,appuserAthletePassportOcrPost } from '/@/api/match/appuser';
|
||||
import { appuserAthletePageGet, appuserAthleteAddPost, appuserAthleteUpdatePut, appuserLeaderPageGet, appuserCoachPageGet } from '/@/api/match/appuser';
|
||||
import { commonOcrRecognizeIdcardPost, commonOcrRecognizePassportPost } from '/@/api/match/common';
|
||||
// 定义表单引用类型
|
||||
const formRef = ref();
|
||||
const activeTab = ref('first')
|
||||
@ -548,8 +549,8 @@ const handleAvatarSuccess = async (response,
|
||||
//response[0].url
|
||||
const imageUrl = response[0].url;
|
||||
const res = ocrType.value === 'passport'
|
||||
? await appuserAthletePassportOcrPost(imageUrl)
|
||||
: await appuserAthleteOcrPost(imageUrl);
|
||||
? await commonOcrRecognizePassportPost({ imageUrl })
|
||||
: await commonOcrRecognizeIdcardPost({ imageUrl });
|
||||
if(res.succeeded){
|
||||
if(ocrType.value === 'passport'){
|
||||
formData.value.name = res.data.name
|
||||
|
||||
@ -97,7 +97,8 @@ import { defineAsyncComponent, ref, reactive } from 'vue';
|
||||
import { ElMessage, ElForm } from 'element-plus';
|
||||
import { Plus } from '@element-plus/icons-vue';
|
||||
import ProTable from '/@/components/ProTable/index.vue';
|
||||
import { appuserCoachPageGet, appuserCoachSavePost, appuserMemberDeletePost, appuserAthleteOcrPost, appuserAthletePassportOcrPost } from '/@/api/match/appuser';
|
||||
import { appuserCoachPageGet, appuserCoachSavePost, appuserMemberDeletePost } from '/@/api/match/appuser';
|
||||
import { commonOcrRecognizeIdcardPost, commonOcrRecognizePassportPost } from '/@/api/match/common';
|
||||
|
||||
// 定义表单引用类型
|
||||
const formRef = ref();
|
||||
@ -204,8 +205,8 @@ const handleAvatarSuccess = async (response,
|
||||
uploadFile) => {
|
||||
const imageUrl = response[0].url;
|
||||
const res = ocrType.value === 'passport'
|
||||
? await appuserAthletePassportOcrPost(imageUrl)
|
||||
: await appuserAthleteOcrPost(imageUrl);
|
||||
? await commonOcrRecognizePassportPost({ imageUrl })
|
||||
: await commonOcrRecognizeIdcardPost({ imageUrl });
|
||||
if (res.succeeded) {
|
||||
if (ocrType.value === 'passport') {
|
||||
formData.value.name = res.data.name
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user