feat: 邮件通知

This commit is contained in:
xiaojunnuo
2023-06-25 15:30:18 +08:00
parent 64afebecd4
commit 937e3fac19
32 changed files with 790 additions and 88 deletions

View File

@@ -106,8 +106,8 @@ function createService() {
* @description 创建请求方法
* @param {Object} service axios 实例
*/
function createRequestFunction(service) {
return function (config) {
function createRequestFunction(service: any) {
return function (config: any) {
const configDefault = {
headers: {
"Content-Type": get(config, "headers.Content-Type", "application/json")

View File

@@ -48,7 +48,10 @@ export function responseError(data = {}, msg = "请求失败", code = 500) {
* @description 记录和显示错误
* @param {Error} error 错误对象
*/
export function errorLog(error) {
export function errorLog(error: any) {
if (error?.response?.data?.message) {
error.message = error?.response?.data?.message;
}
// 打印到控制台
console.error(error);
// 显示提示
@@ -59,8 +62,6 @@ export function errorLog(error) {
* @description 创建一个错误
* @param {String} msg 错误信息
*/
export function errorCreate(msg) {
const error = new Error(msg);
errorLog(error);
throw error;
export function errorCreate(msg: string) {
throw new Error(msg);
}