| | |
| | | import { http } from "./httpClient"; |
| | | |
| | | import { AgentInfo } from '~/shared/models/agent-info.model'; |
| | | import { Consultant } from "../models/consultant.model"; |
| | | |
| | | import _ from "lodash"; |
| | | class MyConsultantService { |
| | | |
| | | async getFavoriteConsultantList(): Promise<Consultant[]> { |
| | |
| | | return http.post(`/appointment/markAsContacted/${appointmentId}`); |
| | | } |
| | | |
| | | // 取得顧問頭像 |
| | | getConsultantAvatar(agentNo:string):Promise<string>{ |
| | | return http.get(`/consultant/avatar/${agentNo}`,{ responseType : 'arraybuffer' }) |
| | | .then( response => { |
| | | const toBase64 = window.btoa( |
| | | _.reduce( new Uint8Array(response.data),(data,byte) => |
| | | data + String.fromCharCode(byte),'') |
| | | ); |
| | | const imgSrc = `data:image/png;base64,${toBase64}`; |
| | | return imgSrc; |
| | | }); |
| | | } |
| | | } |
| | | |
| | | export default new MyConsultantService(); |