| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- #include "respssologin.h"
- #include <QScriptValue>
- #include <QScriptEngine>
- #include <QScriptValueIterator>
- RespSSOLogin::RespSSOLogin(QString json)
- {
- this->json = json;
- QScriptEngine engine;
- QScriptValue sv = engine.evaluate("value = " + this->json);
- QScriptValueIterator it(sv);
- this->userHash = "";
- if(json.isEmpty())
- {
- rtnCode = RTNCODE_NETWORK_NOTAVAILABLE;
- rtnMemo = RTNMEMO_NETWORK_NOTAVAILABLE;
- }
- else if(json=="ABORT")
- {
- rtnCode = RTNCODE_NETWORK_ABORT;
- rtnMemo = RTNMEMO_NETWORK_ABORT;
- }
- else
- {
- rtnCode = RTNCODE_INVALID_FORMAT;
- rtnMemo = RTNMEMO_INVALID_FORMAT;
- while (it.hasNext())
- {
- it.next();
- if(it.name()=="rtnCode")
- {
- this->rtnCode = it.value().toInt32();
- }
- else if(it.name()=="userHash")
- {
- this->userHash = it.value().toString();
- }
- else if(it.name()=="rtnMemo")
- {
- this->rtnMemo = it.value().toString();
- }
- else
- {
- this->userID = it.value().property("userid").toString();
- this->userCode = it.value().property("usercode").toString();
- this->userName = it.value().property("username").toString();
- this->lastLoginTime = it.value().property("lastlogintime").toString();
- this->lastlLoginIp = it.value().property("lastloginip").toString();
- this->startTime = it.value().property("starttime").toString();
- this->endTime = it.value().property("endtime").toString();
- this->remainMoney = it.value().property("remainmoney").toString();
- this->sumMoney = it.value().property("summoney").toString();
- this->giftMoney = it.value().property("giftmoney").toString();
- this->sumGiftMoney = it.value().property("sumgiftmoney").toString();
- this->regType = it.value().property("regtype").toString();
- }
- }
- }
- }
- int RespSSOLogin::getRtnCode()
- {
- return this->rtnCode;
- }
- QString RespSSOLogin::getRtnMemo()
- {
- return this->rtnMemo;
- }
- QString RespSSOLogin::getUserHash()
- {
- return this->userHash;
- }
- QString RespSSOLogin::getUserID()
- {
- return this->userID;
- }
- QString RespSSOLogin::getUserCode()
- {
- return this->userCode;
- }
- QString RespSSOLogin::getUserName()
- {
- return this->userName;
- }
- QString RespSSOLogin::getUserStartTime()
- {
- return this->startTime;
- }
- QString RespSSOLogin::getUserEndTime()
- {
- return this->endTime;
- }
- QString RespSSOLogin::getUserLastLoginTime()
- {
- return this->lastLoginTime;
- }
- QString RespSSOLogin::getUserLastLoginIP()
- {
- return this->lastlLoginIp;
- }
- QString RespSSOLogin::getUserRemainMoney()
- {
- return this->remainMoney;
- }
- QString RespSSOLogin::getUserSumMoney()
- {
- return this->sumMoney;
- }
- QString RespSSOLogin::getUserSumGiftMoney()
- {
- return this->sumGiftMoney;
- }
- QString RespSSOLogin::getUserGiftMoney()
- {
- return this->giftMoney;
- }
- QString RespSSOLogin::getUserRegType()
- {
- return this->regType;
- }
|