保誠-保戶業務員媒合平台
Tomas
2024-01-11 756f8a63347119f511fc964bf1e2ff2417339c56
PAMapp/shared/services/my-consultant.service.ts
@@ -1,9 +1,8 @@
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";
import { Consultant } from "../models/consultant.model";
import { http } from "./httpClient";
class MyConsultantService {
  async getFavoriteConsultantList(): Promise<Consultant[]> {
@@ -56,8 +55,8 @@
    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),'')
                          Array.from(new Uint8Array(response.data)).reduce((data, byte) =>
                            data + String.fromCharCode(byte), '')
                        );
        const imgSrc = `data:image/png;base64,${toBase64}`;
        return imgSrc;