Commit 46916909 by NitefullWind

1. 会员不存在时将会员号返回到phone字段。

parent 4c0cd524
......@@ -51,7 +51,11 @@ void TaskLogin::packagePOSRsp()
posRspJsonObj["name"] = getServerJsonValue("name").toString();
posRspJsonObj["sex"] = getServerJsonValue("sex").toString();
posRspJsonObj["birthday"] = getServerJsonValue("birthday").toString();
posRspJsonObj["phone"] = getServerJsonValue("mobile").toString();
QString phone = getServerJsonValue("mobile").toString();
if(phone.isEmpty()) {
phone = session()->data(PosProps.Phone).toString();
}
posRspJsonObj["phone"] = phone;
posRspJsonObj["address"] = getServerJsonValue("address").toString();
posRspJsonObj["email"] = getServerJsonValue("email").toString();
posRspJsonObj[PosProps.Member_sign] = session()->data(PosProps.Member_sign).toString();
......@@ -70,8 +74,8 @@ void TaskLogin::onLogin()
int status = getServerJsonValue("statusCode").toInt();
// 认证失败
if(status == 2003) {
FMP_INFO() << serverRspJsonObj["msg"].toString();
serverRspJsonObj["phone"] = session()->data(PosProps.Member_sign).toString();
session()->addData("statusCode", status);
session()->addData(PosProps.Phone, session()->data(PosProps.Member_sign).toString());
_window->accept();
return;
}else if(status != FM_API_SUCCESS) {
......
......@@ -35,7 +35,7 @@ QByteArray TaskPay::doTask()
preTask = new TaskLogin(posReqJsonObj, _session, this);
preTask->session()->addData(PosProps.FM_Type, FM_Pay);
QByteArray loginRst = preTask->doTask();
if(preTask->error() != FM_API_SUCCESS) {
if(preTask->error() != FM_API_SUCCESS || (session()->contains(PosProps.StatusCode) && session()->data(PosProps.StatusCode).toInt()!=FM_API_SUCCESS)) {
return loginRst;
}
this->_session = preTask->session();
......
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