日志记录功能
This commit is contained in:
@@ -105,6 +105,7 @@
|
||||
|
||||
<script>
|
||||
import api from "@/packageCa/apiCa/studentProfile.js"
|
||||
import apiuser from "@/packageCa/apiCa/user.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -127,6 +128,27 @@
|
||||
url: `/packageCa/pagesTest/testList`
|
||||
})
|
||||
},
|
||||
// 添加日志
|
||||
postLog(operationType, remarks, beforeData = "", afterData = ""){
|
||||
try {
|
||||
const data = {
|
||||
OperationType: operationType,
|
||||
Remarks: remarks,
|
||||
BeforeOperationJson: beforeData,
|
||||
AfterOperationJson: afterData
|
||||
};
|
||||
console.log(data);
|
||||
// return;
|
||||
// 异步记录日志,不阻塞主流程
|
||||
apiuser.saveUserOperationLog(data).then((res) => {
|
||||
console.log('[Operation Log] 记录成功', res);
|
||||
}).catch((err) => {
|
||||
console.error('[Operation Log] 记录失败', err);
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('[Operation Log] 记录异常', e);
|
||||
}
|
||||
},
|
||||
//选中职业添加
|
||||
async checkedJob(ITEM){
|
||||
uni.showLoading({
|
||||
@@ -141,6 +163,7 @@
|
||||
icon: "none"
|
||||
})
|
||||
this.getGXCareerPlanList();
|
||||
this.postLog(304,`【新增】新增了${ITEM.Name}意向职业`,"",JSON.stringify(ITEM))
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.Message,
|
||||
|
||||
Reference in New Issue
Block a user