提交 4625cd72 编写于 作者: W wq1234wq

移除属性提交过程中多余的accesstoken和设备Id

上级 dce56c38
......@@ -23,9 +23,9 @@ export const DeviceListApi = (params: BasicPageParams) => {
});
};
export const SetAttribute = (params: BasicPageParams) => {
export const SetAttribute = (params: BasicPageParams, accesstoken: string) => {
return defHttp.post({
url: 'Devices/' + params.accesstoken + '/Attributes',
url: 'Devices/' + accesstoken + '/Attributes',
params,
headers: {
ignoreCancelToken: true,
......
......@@ -59,13 +59,16 @@
async function handleSubmit() {
try {
const values = await validate();
console.log(values);
setDrawerProps({ confirmLoading: true });
// TODO custom api
GetIdentity(values.id).then((x) => {
values.accesstoken = x.identityId;
SetAttribute(values).then((y) => {
GetIdentity(values.id).then((x) => {
delete values.id; //remove extra data
// delete values.accesstoken;
SetAttribute(values, x.identityId).then((y) => {
emit('success');
closeDrawer();
});
......@@ -86,7 +89,7 @@
field: x.keyName,
component: 'Input',
label: x.keyName,
defaultValue: x.value,
defaultValue: x.value, //not works,after form created,you need rebind data
colProps: {
span: 8,
},
......@@ -105,13 +108,15 @@
// },
// });
});
//hide id field
updateSchema({
field: 'id',
label: 'id',
component: 'Input',
show: false,
});
//binding field value
setFieldsValue({
...o,
});
......
......@@ -11,7 +11,7 @@
:actions="[
{
label: '修改',
icon: 'ic:outline-delete-outline',
icon: 'clarity:note-edit-line',
onClick: Edit.bind(null, record),
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册