UNPKG

@fast-china/axios

Version:

Fast Axios 请求工具库.

3 lines (2 loc) 710 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.MessageBoxManage=class{_handle;confirm;constructor(){this._handle={confirm:o=>"undefined"!=typeof uni?new Promise((e,n)=>{uni.showModal({title:"温馨提示",content:o.message,cancelText:o.cancelButtonText,confirmText:o.confirmButtonText,success:o=>{o.confirm?e():n()},fail:o=>{throw o&&console.error(o),new Error("'uni.showModal' Api调用异常。")}})}):new Promise((e,n)=>{if(void 0===window.confirm)throw new Error("'window.confirm' Api调用异常。");window.confirm(o.message)?e():n()})};const o=o=>this._handle.confirm(o);o.use=o=>{this._handle.confirm=o},this.confirm=o}}; //# sourceMappingURL=messageBox.js.map