From cfd8c1b9f5acce841d118d951458565d16ba5719 Mon Sep 17 00:00:00 2001
From: 劉鈞霖 <benson@gmail.com>
Date: 星期三, 24 十一月 2021 14:59:46 +0800
Subject: [PATCH] Merge branch 'master' of ssh://dev.pollex.com.tw:29418/pcalife/PAM

---
 PAMapp/assets/ts/api/consultant.ts |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/PAMapp/assets/ts/api/consultant.ts b/PAMapp/assets/ts/api/consultant.ts
index ff69152..382a492 100644
--- a/PAMapp/assets/ts/api/consultant.ts
+++ b/PAMapp/assets/ts/api/consultant.ts
@@ -8,6 +8,21 @@
     return service.post('/authenticate', user)
 }
 
+// 憿批恥��-��TP
+export function sendOtp(loginInfo: LoginRequest) {
+    return service.post<OtpInfo>('/otp/sendOtp', loginInfo).then(res => res.data)
+}
+
+// 憿批恥��-撽�tp銝衣�
+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憛俟MS��府甈葆�����MAIL��葆��隞嗡縑蝞� */
+    account: string,
+}
+
+export interface OtpInfo {
+    /** ��撣嗅otp隤��� */
+    indexKey: string,
+    /** Otp�������� */
+    success: boolean,
+    failCode: string,
+    failReason: string,
+}
+
+export interface LoginVerify {
+    /** �撣嗅����mail */
+    account: string,
+    /** �otp��pi���ndex key */
+    indexKey: string,
+    /** �����縑蝞望�����Ⅳ */
+    otpCode: string
+}
+
+export interface RegisterInfo {
+    phone?: string,
+    email?: string,
+    indexKey: string,
+    otpCode: string,
+    name: string,
+    /** "SMS"嚗tp������"EMAIL":Otp�email */
+    contactType: string
+}
\ No newline at end of file

--
Gitblit v1.8.0