保誠-保戶業務員媒合平台
劉鈞霖
2021-11-24 cfd8c1b9f5acce841d118d951458565d16ba5719
PAMapp/assets/ts/api/consultant.ts
@@ -8,6 +8,21 @@
    return service.post('/authenticate', user)
}
// 顧客登入-發送OTP
export function sendOtp(loginInfo: LoginRequest) {
    return service.post<OtpInfo>('/otp/sendOtp', loginInfo).then(res => res.data)
}
// 顧客登入-驗證otp並登入
export function loginVerify(loginVerify: LoginVerify) {
    return service.post('/otp/verify', loginVerify)
}
// 顧客註冊
export function register(registerInfo: RegisterInfo) {
    return service.post('/otp/register', registerInfo)
}
// 推薦保險顧問
export function recommend() {
    return service.get<Consultants[]>('/consultant/recommend')
@@ -158,3 +173,37 @@
    id_token:string;
}
export interface LoginRequest {
    /** "SMS"=手機,"EMAIL"=email */
    loginType: string,
    /** 若loginType填SMS則該欄帶入手機、EMAIL則帶入郵件信箱 */
    account: string,
}
export interface OtpInfo {
    /** 用於帶入otp認證時 */
    indexKey: string,
    /** Otp是否有成功發送 */
    success: boolean,
    failCode: string,
    failReason: string,
}
export interface LoginVerify {
    /** 可帶入手機或email */
    account: string,
    /** 由otp的api回的index key */
    indexKey: string,
    /** 由手機或信箱收到的認證碼 */
    otpCode: string
}
export interface RegisterInfo {
    phone?: string,
    email?: string,
    indexKey: string,
    otpCode: string,
    name: string,
    /** "SMS":Otp發送手機,"EMAIL":Otp發email */
    contactType: string
}