wangqiujuan0808 2023-12-26 15:10:44 +08:00
commit a4e2b8c0a2
1 changed files with 23 additions and 3 deletions

View File

@ -81,11 +81,31 @@ export default {
const saveFormData = () => {
ruleFormRef.value.validate(async (valid) => {
if (valid) {
const req_databuf = rule_info.encode(state.addForm).finish();
const req_databuf = rule_info.encode({
label:state.addForm.title,
info:state.addForm.description
}).finish();
//
const req_data = req_databuf.slice(0, req_databuf.length);
const res = await infoApi.postRules(req_data);
const req_databuf1 = post.encode({
cmd: 1,
data: req_data,
}).finish();
//
const req_data1 = req_databuf1.slice(0, req_databuf1.length);
const req_databuf2 = post.encode({
cmd: 5,
data: req_data,
}).finish();
//
const req_data2 = req_databuf2.slice(0, req_databuf2.length);
const res = props.type === 'I' ? await infoApi.postJsonRequest(req_data1) : await infoApi.postJsonRequest(req_data2);
console.log(555, res)
const ret = response.decode(new Uint8Array(res));
console.log(555, ret)
if (ret.code == 0) {