Commit b91911b7 by 王昆

gsb

parent 35103843
......@@ -21,23 +21,23 @@ class UserService extends ServiceBase {
*/
async addUser(params) {
try {
var relation = await this.opuserrelationDao.findOne({
ucname: params.ucname
});
if (!relation) {
var rs = await this.platformUtils.createUserInfo(params.ucname, params.ucname, params.password);
if (!rs.data || !rs.data.account_id) {
return rs;
}
params.ucid = rs.data.account_id;
await this.opuserrelationDao.model.create({
ucname: params.ucname,
ucid: rs.data.account_id,
});
} else {
params.ucid = relation.ucid;
}
// var relation = await this.opuserrelationDao.findOne({
// ucname: params.ucname
// });
//
// if (!relation) {
// var rs = await this.platformUtils.createUserInfo(params.ucname, params.ucname, params.password);
// if (!rs.data || !rs.data.account_id) {
// return rs;
// }
// params.ucid = rs.data.account_id;
// await this.opuserrelationDao.model.create({
// ucname: params.ucname,
// ucid: rs.data.account_id,
// });
// } else {
// params.ucid = relation.ucid;
// }
return await this.callms("uc", "addUser", params);
} catch (error) {
return system.getResult(null, `系统错误 错误信息 ${error}`);
......@@ -113,12 +113,12 @@ class UserService extends ServiceBase {
*/
async updPassword(params) {
try {
var user = await this.callms("uc", "userInfo", params);
user = user.data;
var rs = await this.platformUtils.modifyPassword(user.ucid, params.password);
if (rs.status !== 0) {
return rs;
}
// var user = await this.callms("uc", "userInfo", params);
// user = user.data;
// var rs = await this.platformUtils.modifyPassword(user.ucid, params.password);
// if (rs.status !== 0) {
// return rs;
// }
await this.callms("uc", "updPassword", params);
return system.getResultSuccess();
} catch (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment