Skip to content

Commit 78a7fcc

Browse files
committed
improved:user insert and modify init value for management app
1 parent b80be80 commit 78a7fcc

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

XEngine_Source/AuthorizeModule_Configure/Config_Define.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ typedef struct
6666
bool bTime;
6767
bool bCustom;
6868
}st_MulitLogin;
69+
struct
70+
{
71+
bool bAutoRenewal;
72+
int nRenewalTime;
73+
}st_XToken;
6974
}st_XLogin;
7075
struct
7176
{

XEngine_Source/AuthorizeModule_Configure/ModuleConfigure_Json/ModuleConfigure_Json.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
118118
_tcsxcpy(pSt_ServerConfig->st_XVerification.st_XCDKey.tszKeyFile, st_JsonXVerification["st_XCDKey"]["tszKeyFile"].asCString());
119119
_tcsxcpy(pSt_ServerConfig->st_XVerification.st_XCDKey.tszKeyPass, st_JsonXVerification["st_XCDKey"]["tszKeyPass"].asCString());
120120
//登录配置
121-
if (st_JsonRoot["XLogin"].empty() || (5 != st_JsonRoot["XLogin"].size()))
121+
if (st_JsonRoot["XLogin"].empty() || (6 != st_JsonRoot["XLogin"].size()))
122122
{
123123
Config_IsErrorOccur = true;
124124
Config_dwErrorCode = ERROR_AUTHORIZE_MODULE_CONFIGURE_XVER;
@@ -139,6 +139,10 @@ bool CModuleConfigure_Json::ModuleConfigure_Json_File(LPCXSTR lpszConfigFile, XE
139139
pSt_ServerConfig->st_XLogin.st_MulitLogin.bDay = st_JsonMulitLogin["bDay"].asBool();
140140
pSt_ServerConfig->st_XLogin.st_MulitLogin.bSecond = st_JsonMulitLogin["bSecond"].asBool();
141141
pSt_ServerConfig->st_XLogin.st_MulitLogin.bTime = st_JsonMulitLogin["bTime"].asBool();
142+
143+
Json::Value st_JsonXToken = st_JsonXLogin["st_XToken"];
144+
pSt_ServerConfig->st_XLogin.st_XToken.bAutoRenewal = st_JsonXToken["bAutoRenewal"].asBool();
145+
pSt_ServerConfig->st_XLogin.st_XToken.nRenewalTime = st_JsonXToken["nRenewalTime"].asInt();
142146
//加密配置
143147
if (st_JsonRoot["XCrypto"].empty() || (2 != st_JsonRoot["XCrypto"].size()))
144148
{

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Modify.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ void CDialog_Modify::DoDataExchange(CDataExchange* pDX)
3333
DDX_Control(pDX, IDC_COMBO1, m_ComboSerial);
3434
DDX_Control(pDX, IDC_COMBO2, m_ComboLeave);
3535
DDX_Control(pDX, IDC_EDIT7, m_EditHardCode);
36-
DDX_Control(pDX, IDC_EDIT8, m_EditCreateTime);
3736
DDX_Control(pDX, IDC_BUTTON2, m_BtnModify);
37+
DDX_Control(pDX, IDC_DATETIMEPICKER1, m_DateTimeRegister);
3838
}
3939

4040

@@ -63,12 +63,15 @@ BOOL CDialog_Modify::OnInitDialog()
6363
{
6464
m_ComboLeave.InsertString(i, lpszXLevelType[i]);
6565
}
66-
66+
m_DateTimeRegister.SetFormat(_T("yyyy-MM-dd HH:mm:ss"));
6767
POSITION pSt_Sition = pUserWnd->m_ListCtrlClient.GetFirstSelectedItemPosition();
6868
if (NULL == pSt_Sition)
6969
{
7070
//没有选择,表示添加
7171
m_BtnModify.SetWindowText(_T("添加"));
72+
73+
m_ComboSerial.SetCurSel(1);
74+
m_ComboLeave.SetCurSel(11);
7275
}
7376
else
7477
{
@@ -144,7 +147,11 @@ BOOL CDialog_Modify::OnInitDialog()
144147
m_EditUser.SetWindowText(st_JsonObject["st_UserInfo"]["tszUserName"].asCString());
145148
m_EditPass.SetWindowText(st_JsonObject["st_UserInfo"]["tszUserPass"].asCString());
146149
m_EditEMail.SetWindowText(st_JsonObject["st_UserInfo"]["tszEMailAddr"].asCString());
147-
m_EditCreateTime.SetWindowText(st_JsonObject["st_UserInfo"]["tszCreateTime"].asCString());
150+
COleDateTime m_OleDTime;
151+
if (m_OleDTime.ParseDateTime(st_JsonObject["st_UserInfo"]["tszCreateTime"].asCString()))
152+
{
153+
m_DateTimeRegister.SetTime(m_OleDTime);
154+
}
148155

149156
CString m_StrNumber;
150157
m_StrNumber.Format(_T("%lld"), st_JsonObject["st_UserInfo"]["nIDNumber"].asUInt64());
@@ -179,7 +186,7 @@ void CDialog_Modify::OnBnClickedButton2()
179186
m_EditUser.GetWindowText(st_UserTable.st_UserInfo.tszUserName, sizeof(st_UserTable.st_UserInfo.tszUserName));
180187
m_EditPass.GetWindowText(st_UserTable.st_UserInfo.tszUserPass, sizeof(st_UserTable.st_UserInfo.tszUserPass));
181188
m_EditEMail.GetWindowText(st_UserTable.st_UserInfo.tszEMailAddr, sizeof(st_UserTable.st_UserInfo.tszEMailAddr));
182-
m_EditCreateTime.GetWindowText(st_UserTable.st_UserInfo.tszCreateTime, sizeof(st_UserTable.st_UserInfo.tszCreateTime));
189+
m_DateTimeRegister.GetWindowText(st_UserTable.st_UserInfo.tszCreateTime, sizeof(st_UserTable.st_UserInfo.tszCreateTime));
183190
m_EditHardCode.GetWindowText(st_UserTable.tszHardCode, sizeof(st_UserTable.tszHardCode));
184191

185192
CString m_StrNumber;

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Modify.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CDialog_Modify : public CDialogEx
3333
CComboBox m_ComboLeave;
3434
afx_msg void OnBnClickedButton2();
3535
CEdit m_EditHardCode;
36-
CEdit m_EditCreateTime;
3736
CButton m_BtnModify;
3837
afx_msg void OnBnClickedButton3();
38+
CDateTimeCtrl m_DateTimeRegister;
3939
};
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)