日志记录功能
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
|
||||
<script>
|
||||
import api from "@/packageCa/apiCa/testManage.js"
|
||||
import apiuser from "@/packageCa/apiCa/user.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -145,6 +146,27 @@
|
||||
},300)
|
||||
}
|
||||
},
|
||||
// 添加日志
|
||||
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);
|
||||
}
|
||||
},
|
||||
// 提交题目
|
||||
submitTitle() {
|
||||
let testStr = "";
|
||||
@@ -197,6 +219,10 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
this.postLog(201,`【新增】保存工作测评`,"",JSON.stringify({
|
||||
TestType: 17,
|
||||
TestStr: testStr
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user