import { HostConfig } from '../config/host.config'; import { Injectable } from '@angular/core'; import { HttpHandler } from './http-handler.service'; import { Page } from '../response/page.type'; @Injectable({ providedIn: 'root', }) export class WxPortalService { static PATH = '/wx/portal/{appid}'; constructor(private httpHandler: HttpHandler) {} authGet(appid: string,signature: string,timestamp: string,nonce: string,echostr: string, header?: any): Promise { return this.httpHandler.(`${HostConfig.DEV_HOST}${WxPortalService.PATH}?signature=${signature}×tamp=${timestamp}&nonce=${nonce}&echostr=${echostr}`, header); } post(appid: string,requestBody: string,msgSignature: string,encryptType: string,signature: string,timestamp: string,nonce: string, header?: any): Promise { return this.httpHandler.(`${HostConfig.DEV_HOST}${WxPortalService.PATH}?msgSignature=${msgSignature}&encryptType=${encryptType}&signature=${signature}×tamp=${timestamp}&nonce=${nonce}` ,requestBody, header); } route(message: WxMaMessage,appid: string, header?: any): Promise { return this.httpHandler.(`${HostConfig.DEV_HOST}${WxPortalService.PATH}`, header); } }