| | |
| | | import { AxiosResponse } from 'axios'; |
| | | import { AppointmentDetail } from '../models/AppointmentDetail'; |
| | | import { ConsultantLoginInfo } from '../models/ConsultantLoginInfo'; |
| | | import _ from 'lodash'; |
| | | |
| | | // 顧客登入(TODO: OTP認證開發前 暫時使用) |
| | | export function login(user: any) { |
| | |
| | | return service.delete('/consultant/favorite/'+agentId, {headers}) |
| | | } |
| | | |
| | | // 忘記密碼網址 |
| | | export function getForgotPasswordLink():Promise<string>{ |
| | | return new Promise((resolve, reject)=>{ |
| | | resolve('https://www.google.com/'); |
| | | }) |
| | | // 取得驗證碼圖片 |
| | | export function getImgOfVerification():Promise<string>{ |
| | | return service.get('/login/validate/get_img_code',{ responseType : 'arraybuffer' }) |
| | | .then(response=>{ |
| | | const toBase64 = window.btoa(_.reduce(new Uint8Array(response.data),(data,byte)=>data + String.fromCharCode(byte),'')); |
| | | const imgSrc = `data:image/jpeg;base64,${toBase64}`; |
| | | return imgSrc; |
| | | }); |
| | | } |
| | | |
| | | // 取得驗證碼圖片 |
| | | export function getVerificationCodeImg():Promise<string>{ |
| | | return new Promise((resolve, reject)=>{ |
| | | resolve(''); |
| | | }) |
| | | // 驗證碼 驗證 |
| | | export function getVerificationStatus(imgCode:string):Promise<AxiosResponse<boolean>>{ |
| | | return service.get('/login/validate/verify_img_code/'+imgCode); |
| | | } |
| | | |
| | | // 顧問登入 |
| | |
| | | new: boolean; |
| | | } |
| | | export interface RequestOfLoginSuccess{ |
| | | id_token:string; |
| | | id_token: string; |
| | | } |
| | | |
| | | export interface LoginRequest { |