Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
req: function (payload) {
// console.log("request initiate", payload);
if (payload.config.method !== 'GET' && payload.config.method !== 'OPTIONS') {
// console.log("Create request complete: ", payload, payload.status / 100);
if (parseInt(payload.status / 100) == 2) {
var action = "Created ";
if (payload.config.method == "DELETE") {
action = "Deleted "
} else if (payload.config.method == "PUT" || payload.config.method == "PATCH") {
action = "Updated "
}
Notification.success({
title: action + payload.config.model
})
} else {
Notification.warn({
"title": "Unidentified status"
})
}
}
return payload
},
res: function (r) {
req: function (payload) {
console.log("request initiate", payload);
let requestMethod = payload.config.method.toUpperCase();
if (requestMethod !== 'GET' && requestMethod !== 'OPTIONS') {
// console.log("Create request complete: ", payload, payload.status / 100);
if (parseInt(payload.status / 100) === 2) {
let action = "Created ";
if (requestMethod === "DELETE") {
action = "Deleted "
} else if (requestMethod === "PUT" || requestMethod === "PATCH") {
action = "Updated "
}
Notification.success({
title: action + payload.config.model
});
console.log("return payload from response middleware")
} else {
Notification.warn({
"title": "Unidentified status"
})
}
}
return payload
},
res: function (r) {
req: function (payload) {
// console.log("request initiate", payload);
if (payload.config.method !== 'GET' && payload.config.method !== 'OPTIONS') {
// console.log("Create request complete: ", payload, payload.status / 100);
if (parseInt(payload.status / 100) === 2) {
let action = "Created ";
if (payload.config.method === "DELETE") {
action = "Deleted "
} else if (payload.config.method === "PUT" || payload.config.method === "PATCH") {
action = "Updated "
}
Notification.success({
title: action + payload.config.model
});
console.log("return payload from response middleware")
} else {
Notification.warn({
"title": "Unidentified status"
})
}
}
return payload
},
res: function (r) {
const data = {
evt,
...addtional,
action_time: format(Date.now())
};
if (evt === "1") {
Message("统计UVPV埋点");
}
if (evt === "2") {
Message({
message: "统计页面停留时间埋点",
customClass: "message-offset"
});
}
Notification.success({
title: "上报数据如下:",
dangerouslyUseHTMLString: true,
message: createFragment(data),
customClass: "notification__large",
position: evt === "1" || evt === "2" ? "top-left" : "top-right"
});
}
machine["reference_id"]).then(function (res) {
Notification.success({
title: "Done",
message: "Started tracking status for " + that.selectedTable
});
that.updateStates();
});
},
that.currentUser.httpUserResetPassword(value, function (response) {
Notification.success({
message: '重置密码成功!'
})
})
}).catch(() => {
export function success (message: string): void {
Notification.success({
title: '成功',
duration: 2000,
message
})
}
worldManager.trackObjectEvent(this.selectedTable, action.id, event.name).then(function () {
Notification.success({
title: "Updated",
message: that.selectedTable + " status was updated for this track"
});
that.updateStates();
}, function () {
Notification.error({
this.tag.httpSave(function (response) {
Notification.success({
message: that.tag.editMode ? '修改标签成功!' : '创建标签成功!'
})
that.$router.go(-1)
})
}
.then(res => {
this.close()
Notification.success({
title: '提交成功',
message: '您的提交最早将会出现在明天的日报中'
})
})
.catch(err => {