Commit fdecf198 by 任晓松

update

parent c5ffeb4c
...@@ -411,7 +411,35 @@ class OpPlatformUtils { ...@@ -411,7 +411,35 @@ class OpPlatformUtils {
return system.getResultFail(system.verifyVCodeFail, "验证码校验不成功,请重新获取验证码验证.", system.verifyVCodeFail); return system.getResultFail(system.verifyVCodeFail, "验证码校验不成功,请重新获取验证码验证.", system.verifyVCodeFail);
} }
const uPassword = await this.getEncryptStr(actionBody.newPwd);//uPassword const uPassword = await this.getEncryptStr(actionBody.newPwd);//uPassword
await this.appuserDao.updateByWhere({ password: uPassword }, { where: { channel_userid: actionBody.mobile, uapp_id: pobj.appInfo.uapp_id } }) await this.appuserDao.updateByWhere({ password: uPassword }, { where: { channel_userid: pobj.userInfo.channel_userid, uapp_id: pobj.appInfo.uapp_id } })
return system.getResultSuccess();
}
/**
* 通过手机验证码修改用户手机号、邮箱,前端修改后要移除掉userpin让用户进行重新登录
* @param {*} pobj
* @param {*} actionBody {mobile:XX,vcode:XXX,email:XXX}
*/
async putUserMobileByVcode(pobj, actionBody) {
if (!actionBody.vcode) {
return system.getResult(null, "pobj.vcode can not be empty !");
}
if (!pobj.appInfo) {
return system.getResult(null, "pobj.appInfo can not be empty !");
}
let cacheManager = system.getObject("db.common.cacheManager");
var inputkey = pobj.appInfo.uapp_key + "_" + pobj.actionBody.mobile;
var cacheCode = await cacheManager["VCodeCache"].getCache(inputkey);
if (!cacheCode || pobj.vcode != cacheCode.vcode) {
return system.getResultFail(system.verifyVCodeFail, "验证码校验不成功,请重新获取验证码验证.", system.verifyVCodeFail);
}
let updateObj = {};
if(actionBody.newMobile){
updateObj.mobile = actionBody.newMobile;
}
if(actionBody.email){
updateObj.emial = actionBody.email;
}
await this.appuserDao.updateByWhere(updateObj, { where: { channel_userid: pobj.userInfo.channel_userid, uapp_id: pobj.appInfo.uapp_id } })
return system.getResultSuccess(); return system.getResultSuccess();
} }
/** /**
......
...@@ -4,6 +4,7 @@ const exec = util.promisify(require('child_process').exec); ...@@ -4,6 +4,7 @@ const exec = util.promisify(require('child_process').exec);
const querystring = require('querystring'); const querystring = require('querystring');
var settings = require("../../config/settings"); var settings = require("../../config/settings");
const uuidv4 = require('uuid/v4'); const uuidv4 = require('uuid/v4');
const axios = require('axios')
class RestClient { class RestClient {
constructor() { constructor() {
this.cmdGetPattern = "curl {-G} -k -d '{data}' {url}"; this.cmdGetPattern = "curl {-G} -k -d '{data}' {url}";
...@@ -87,6 +88,13 @@ class RestClient { ...@@ -87,6 +88,13 @@ class RestClient {
return result; return result;
} }
async execPost(subData, url) { async execPost(subData, url) {
if(settings.env == 'dev'){
const rs = await axios.post(url,subData);
const ret ={
stdout:JSON.stringify(rs.data)
}
return ret;
}
let cmd = this.FetchPostCmd(subData, url); let cmd = this.FetchPostCmd(subData, url);
var result = await this.exec(cmd, { var result = await this.exec(cmd, {
maxBuffer: 10000 * 1024 maxBuffer: 10000 * 1024
...@@ -94,6 +102,11 @@ class RestClient { ...@@ -94,6 +102,11 @@ class RestClient {
return result; return result;
} }
async execPostWithAK(subData, url, ak) { async execPostWithAK(subData, url, ak) {
if(settings.env == 'dev'){
axios.defaults.headers['AccessKey'] = ak;
const rs = await axios.post(url,subData);
return rs.data;
}
let cmd = this.FetchPostCmdWithAK(subData, url, ak); let cmd = this.FetchPostCmdWithAK(subData, url, ak);
var result = await this.exec(cmd, { var result = await this.exec(cmd, {
maxBuffer: 1024 * 1024 * 15 maxBuffer: 1024 * 1024 * 15
...@@ -106,6 +119,13 @@ class RestClient { ...@@ -106,6 +119,13 @@ class RestClient {
} }
} }
async execPost2(subData, url) { async execPost2(subData, url) {
if(settings.env == 'dev'){
const rs = await axios.post(url,subData);
const ret ={
stdout:JSON.stringify(rs.data)
}
return ret;
}
let cmd = this.FetchPostCmd2(subData, url); let cmd = this.FetchPostCmd2(subData, url);
console.log(cmd); console.log(cmd);
var result = await this.exec(cmd); var result = await this.exec(cmd);
......
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