已经实现了具体的登录接口
@Mutation(() => Boolean, { description: '登录' })
async login(
@Args('tel') tel: string,
@Args('code') code: string,
): Promise<boolean> {
console.log('调试123/??');
const user = await this.userService.findByTel(tel);
if (!user) {
return false;
}
if (!user.codeCreateTimeAt || !user.code) {
return false;
}
if (dayjs().diff(dayjs(user.codeCreateTimeAt)) > 60 * 60 * 1000) {
return false;
}
if (user.code === code) {
return true;
}
return false;
}
在编写login接口时,我在graphql调试面板编写语句如下:
mutation login($tel:String!,$code:String!){
login(tel:$tel,code:$code)
}
查询参数如下:(手机号写XXXX是因为内容审核不给过。。。。)
{
"tel":"XXXX",
"code":"6585"
}
但是为什么在GraphQL调试面板进行调试时会如下报错呢:我已经传了tel和code了呀