diff --git a/src/api/modules/subaccount.js b/src/api/modules/subaccount.js new file mode 100644 index 0000000..dd36919 --- /dev/null +++ b/src/api/modules/subaccount.js @@ -0,0 +1,52 @@ +import httpRequest from '@/utils/httpRequest' + +// 获取可分配的权限树 +export function getAvailablePermissions () { + return httpRequest({ + url: httpRequest.adornUrl('/merchant-api/subaccount/available-permissions'), + method: 'get' + }) +} + +// 创建子账号 +export function createSubAccount (data) { + return httpRequest({ + url: httpRequest.adornUrl('/merchant-api/subaccount/create'), + method: 'post', + data: httpRequest.adornData(data) + }) +} + +// 获取子账号列表 +export function getSubAccountList () { + return httpRequest({ + url: httpRequest.adornUrl('/merchant-api/subaccount/list'), + method: 'get' + }) +} + +// 获取子账号详情 +export function getSubAccountDetail (id) { + return httpRequest({ + url: httpRequest.adornUrl(`/merchant-api/subaccount/${id}`), + method: 'get' + }) +} + +// 更新子账号 +export function updateSubAccount (data) { + return httpRequest({ + url: httpRequest.adornUrl('/merchant-api/subaccount/update'), + method: 'put', + data: httpRequest.adornData(data) + }) +} + +// 检查用户名是否可用 +export function checkUsername (username) { + return httpRequest({ + url: httpRequest.adornUrl('/merchant-api/subaccount/check-username'), + method: 'get', + params: { username } + }) +} diff --git a/src/router/full-routers.js b/src/router/full-routers.js index 479e566..c6f7f35 100644 --- a/src/router/full-routers.js +++ b/src/router/full-routers.js @@ -195,6 +195,46 @@ export default { open: null, list: [] }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "权限管理", + url: "operation-management/permission", + perms: "operation-management:permission", + type: 0, + elIcon: "el-icon-lock", + orderNum: 0, + open: null, + list: [ + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "子经营者管理", + url: "operation-management/permission/sub-operator/index", + perms: "operation-management:permission:sub-operator:index", + type: 1, + elIcon: "el-icon-user", + orderNum: 0, + open: null, + list: [] + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "商户账号管理", + url: "operation-management/permission/merchant-account/index", + perms: "operation-management:permission:merchant-account:index", + type: 1, + elIcon: "el-icon-user-solid", + orderNum: 0, + open: null, + list: [] + } + ] + }, // { // menuId: getUUID(), // parentId: 0, @@ -223,6 +263,46 @@ export default { // } ] }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "权限管理", + url: "operation-management/permission", + perms: "operation-management:permission", + type: 0, + elIcon: "el-icon-lock", + orderNum: 0, + open: null, + list: [ + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "子经营者管理", + url: "operation-management/permission/sub-operator/index", + perms: "operation-management:permission:sub-operator:index", + type: 1, + elIcon: "el-icon-user", + orderNum: 0, + open: null, + list: [] + }, + { + menuId: getUUID(), + parentId: 0, + parentName: null, + name: "商户账号管理", + url: "operation-management/permission/merchant-account/index", + perms: "operation-management:permission:merchant-account:index", + type: 1, + elIcon: "el-icon-user-solid", + orderNum: 0, + open: null, + list: [] + } + ] + }, { menuId: getUUID(), parentId: 0, diff --git a/src/views/modules/operation-management/permission/merchant-account/index.vue b/src/views/modules/operation-management/permission/merchant-account/index.vue new file mode 100644 index 0000000..194048e --- /dev/null +++ b/src/views/modules/operation-management/permission/merchant-account/index.vue @@ -0,0 +1,13 @@ + + 商户账号管理 + + + + + diff --git a/src/views/modules/operation-management/permission/sub-operator/index.vue b/src/views/modules/operation-management/permission/sub-operator/index.vue new file mode 100644 index 0000000..7357a79 --- /dev/null +++ b/src/views/modules/operation-management/permission/sub-operator/index.vue @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + + + + + + + +