Skip to content

Commit

Permalink
fix(devops-server): 修复预置云函数 init-app-rbac 以适配新 API;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Aug 9, 2021
1 parent b74f771 commit d91de4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/devops-server/init/functions/init-app-rbac/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
return
}

await cloud.mongodb.collection('admins').createIndex('username', { unique: true })
await cloud.mongo.db.collection('admins').createIndex('username', { unique: true })

const { data } = await db.collection('roles').get()
const roles = data.map(it => it.name)
Expand Down Expand Up @@ -90,7 +90,7 @@
async function createFirstRole() {
try {

await cloud.mongodb.collection('roles').createIndex('name', { unique: true })
await cloud.mongo.db.collection('roles').createIndex('name', { unique: true })

const r_perm = await db.collection('permissions').get()
assert(r_perm.ok, 'get permissions failed')
Expand Down Expand Up @@ -122,7 +122,7 @@
async function createInitialPermissions() {

// 创建唯一索引
await cloud.mongodb.collection('permissions').createIndex('name', { unique: true })
await cloud.mongo.db.collection('permissions').createIndex('name', { unique: true })

for (const perm of permissions) {
try {
Expand Down

0 comments on commit d91de4a

Please sign in to comment.