|
@@ -85,6 +85,20 @@ class UserService extends CrudService {
|
|
|
return user;
|
|
|
}
|
|
|
|
|
|
+ // 学校用户生成
|
|
|
+ async schoolregister() {
|
|
|
+ const schools = await this.schModel.find();
|
|
|
+ for (const sch of schools) {
|
|
|
+ const user = await this.model.findOne({ uid: sch.id, type: '2' });
|
|
|
+ if (!user) {
|
|
|
+ const newdata = { name: sch.name, mobile: sch.code, type: '2', uid: sch.id };
|
|
|
+ newdata.passwd = { secret: '12345678' };
|
|
|
+ await this.model.create(newdata);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.ctx.ok({ data: {} });
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
module.exports = UserService;
|