import * as util from 'util' ; import { AccessTokenApi , AccessToken } from '@tnwx/accesstoken' ; import { HttpKit } from '@tnwx/kits' ; author Javen
 *  copyright description export class UniformMessageApi { private static sendUniformMessageUrl : string = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=%s' ; param touser param weappTemplateMsg param mpTemplateMsg public static async sendUniformMessage ( touser , mpTemplateMsg , weappTemplateMsg ? ) { let accessToken = await AccessTokenApi . getAccessToken ( ) ; let url = util . format ( this . sendUniformMessageUrl , ( < AccessToken > accessToken ) . getAccessToken ) ; return HttpKit . getHttpDelegate . httpPost ( url , JSON . stringify ( { touser : touser , mp_template_msg : mpTemplateMsg , weapp_template_msg : weappTemplateMsg } ) ) ; } }