|
@@ -78,7 +78,7 @@ class UserService extends CrudService {
|
|
|
|
|
|
// 学生绑定
|
|
// 学生绑定
|
|
async bind(data) {
|
|
async bind(data) {
|
|
- const { openid, id_number, mobile, unionid } = data;
|
|
|
|
|
|
+ const { openid, id_number, mobile, unionid } = data;
|
|
assert(openid && id_number && mobile, '缺少部分信息项');
|
|
assert(openid && id_number && mobile, '缺少部分信息项');
|
|
let user = await this.model.findOne({ mobile });
|
|
let user = await this.model.findOne({ mobile });
|
|
if (user) {
|
|
if (user) {
|
|
@@ -136,6 +136,12 @@ class UserService extends CrudService {
|
|
const user = await this.model.findOne({ openid });
|
|
const user = await this.model.findOne({ openid });
|
|
return user;
|
|
return user;
|
|
}
|
|
}
|
|
|
|
+ // 通过openid查询用户信息
|
|
|
|
+ async findByAppOpenid(appopenid) {
|
|
|
|
+ // 通过openid查询用户信息
|
|
|
|
+ const user = await this.model.findOne({ appopenid });
|
|
|
|
+ return user;
|
|
|
|
+ }
|
|
|
|
|
|
// 通过unionid查询用户信息
|
|
// 通过unionid查询用户信息
|
|
async findByunionid(unionid) {
|
|
async findByunionid(unionid) {
|