This commit is contained in:
robin committed 2022-07-07 22:16:39 +08:00
1 parent 264ab8d979
commit a9a4bd0981
86 files changed
+1196 -308

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
'use strict';
module.exports = {
params: {
"type": ["accountPassword"],//登录类型
"data": "object",//数据
},
fun : async (ctx, app) => {
const {type, data} = ctx.params
if (await $components.login[type](data)) {
return $res.success({
token: await $components.jwt.sign({})
}, "登录成功")
}
return $res.error({}, "登录失败")
}
}
+19
View File
@@ -0,0 +1,19 @@
'use strict';
module.exports = {
params: {
"type": ["accountPassword"],//注册类型
"data": "object",//数据
},
fun : async (ctx, app) => {
const {type, data} = ctx.params
if (await $components.registered[type](data)) {
return $res.success({
token: await $components.jwt.sign({})
}, "注册成功")
}
return $res.error({}, "登录失败")
}
}