From f8858063c1daa9f9255206759bd11a30ee19980a Mon Sep 17 00:00:00 2001 From: Benson <benson@pollex.com> Date: 星期四, 30 十二月 2021 17:53:51 +0800 Subject: [PATCH] [Update] : 顧問頭像編輯 測試 --- PAMapp/shared/services/my-consultant.service.ts | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/PAMapp/shared/services/my-consultant.service.ts b/PAMapp/shared/services/my-consultant.service.ts index ed06483..c48821a 100644 --- a/PAMapp/shared/services/my-consultant.service.ts +++ b/PAMapp/shared/services/my-consultant.service.ts @@ -1,8 +1,7 @@ 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[]> { @@ -37,6 +36,18 @@ 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(); -- Gitblit v1.8.0