common.js 840 字节
/**
 * Created by sunke on 2020/8/19.
 */

toastr.options = {
    "closeButton": true,
    "debug": false,
    "positionClass": "toast-top-center",
    "onclick": null,
    "showDuration": "1000",
    "hideDuration": "1000",
    "timeOut": "5000",
    "extendedTimeOut": "1000",
    "showEasing": "swing",
    "hideEasing": "linear",
    "showMethod": "fadeIn",
    "hideMethod": "fadeOut"
}

var msgObj = null;
showMsg = function(text){
    if(msgObj){
        toastr.clear(msgObj);
        msgObj = null;
    }
    if(text.indexOf("0") == 0){
        msgObj = toastr.success(text.substr(1));
    }else if(text.indexOf("1") == 0){
        msgObj = toastr.warning(text.substr(1));
    }else if(text.indexOf("2") == 0){
        msgObj = showError(text);
    }else {
        if(text){
            msgObj = toastr.info(text);
        }
    }
}