/* * @Author: yangzonglong * @Date: 2020-09-10 10:52:18 * @version: v1.0.0 * @Descripttion: 通用message * @LastEditors: yangzonglong * @LastEditTime: 2021-08-12 10:59:14 * @Auditor: */ import { message } from 'antd'; const top: any = window.parent; // core type ErrorProps = { code?: string; message?: string } function tMsg(msg: string) { return window.t ? window.t(msg) : msg } export function success(msg: string) { if (top.success) return top.success(tMsg(msg)); message.success(tMsg(msg)) } export function error(msg: string, err?: ErrorProps) { if (top.error) return top.error(tMsg(msg), err); message.error(tMsg(msg)); } export function warning(msg: string) { if (top.warning) return top.warning(tMsg(msg)); message.warning(tMsg(msg)) } export default { success, error, warning }