From 6fa4bba623713c396432ba8b863846883d6a1906 Mon Sep 17 00:00:00 2001 From: wayne <wayne8692wayne8692@gmail.com> Date: 星期三, 26 一月 2022 10:52:23 +0800 Subject: [PATCH] Merge branch 'pollex-dev' into sit --- PAMapp/shared/services/my-consultant.service.ts | 24 +++++++++++++++++------- 1 files changed, 17 insertions(+), 7 deletions(-) diff --git a/PAMapp/shared/services/my-consultant.service.ts b/PAMapp/shared/services/my-consultant.service.ts index ed06483..3d4dd78 100644 --- a/PAMapp/shared/services/my-consultant.service.ts +++ b/PAMapp/shared/services/my-consultant.service.ts @@ -1,8 +1,9 @@ -import { http } from "./httpClient"; +import _ from "lodash"; +import { http } from "./httpClient"; import { AgentInfo } from '~/shared/models/agent-info.model'; import { Consultant } from "../models/consultant.model"; - +import { Appointment } from "../models/appointment.model"; class MyConsultantService { async getFavoriteConsultantList(): Promise<Consultant[]> { @@ -30,13 +31,22 @@ } // 璅�撌脰蝯� - markAsContact(appointmentId: number): Promise<void> { - // TODO: 頝�垢蝣箄���ㄐ��� API 銝�府���� void, ���府���敺���� - Ben 2021/11/16 - // return http.post('/appointment/markAsContacted/'+appointmentId, undefined, {headers}) - // .then(res => res.data) - return http.post(`/appointment/markAsContacted/${appointmentId}`); + markAsContact(appointmentId: number): Promise<Appointment> { + return http.post(`/appointment/markAsContacted/${appointmentId}`).then(res => res.data); } + // ���“����� + 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