openxiangda 1.0.196 → 1.0.197
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +19 -18
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -11104,24 +11104,25 @@ async function permission(args) {
|
|
|
11104
11104
|
fail('用法: openxiangda permission role-create <roleCode> --name <text>');
|
|
11105
11105
|
}
|
|
11106
11106
|
const target = getWorkspaceTarget(config, profileName, flags);
|
|
11107
|
-
await
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11107
|
+
const data = await runDirectRequest(config, target, flags, {
|
|
11108
|
+
method: 'POST',
|
|
11109
|
+
path: `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/roles`,
|
|
11110
|
+
body: {
|
|
11111
|
+
code: flags.code || roleCode,
|
|
11112
|
+
name,
|
|
11113
|
+
description: flags.description || '',
|
|
11114
|
+
},
|
|
11115
|
+
}, {
|
|
11116
|
+
returnData: true,
|
|
11117
|
+
mutationLabel: 'permission role-create',
|
|
11118
|
+
});
|
|
11119
|
+
if (!flags['dry-run'] && data?.id) {
|
|
11120
|
+
saveRoleResource(target, roleCode, data.id, {
|
|
11121
|
+
code: data.code,
|
|
11122
|
+
name: data.name,
|
|
11123
|
+
});
|
|
11124
|
+
}
|
|
11125
|
+
return outputDirectResult(data, flags);
|
|
11125
11126
|
}
|
|
11126
11127
|
|
|
11127
11128
|
if (subcommand === 'role-update') {
|