自动递增
This commit is contained in:
@@ -6,15 +6,13 @@ var loginup = async (ctx,next) => {
|
||||
await dbs.find('admin').then((res)=>{
|
||||
arr = res.data
|
||||
})
|
||||
console.timeEnd("asd")
|
||||
|
||||
if(arr.length == 0){
|
||||
await dbs.add('admin',{name:"admin",pwd:"123456"})
|
||||
await dbs.find('admin').then((res)=>{
|
||||
arr = res.data
|
||||
})
|
||||
}
|
||||
|
||||
console.timeEnd("asd")
|
||||
//判断用户名密码
|
||||
if(ctx.request.body.name == arr[0].name && ctx.request.body.pwd == arr[0].pwd){
|
||||
//颁发token
|
||||
|
||||
Reference in New Issue
Block a user