Skip to content

Commit

Permalink
fix: 修复 init 指令修复错误的问题;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Jun 16, 2021
1 parent 56cfa8e commit 6f1b466
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env node

const Config = require('../dist/config').default
const { hash } = require('../dist/lib/utils/token')
const { hashPassword } = require('../dist/lib/utils/hash')
const assert = require('assert')
const { MongoAccessor, getDb } = require('less-api')
const adminRules = require('./rules/admin.json')
Expand Down Expand Up @@ -48,7 +48,7 @@ main()
async function createFirstAdmin() {
try {
const username = Config.SUPER_ADMIN
const password = hash(Config.SUPER_ADMIN_PASSWORD)
const password = hashPassword(Config.SUPER_ADMIN_PASSWORD)

const { total } = await db.collection('admins').count()
if (total > 0) {
Expand Down

0 comments on commit 6f1b466

Please sign in to comment.