Skip to content

Commit d9f7d89

Browse files
committed
fixed:json char is incorrect
1 parent 81999ec commit d9f7d89

File tree

9 files changed

+25
-26
lines changed

9 files changed

+25
-26
lines changed

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Announcement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void CDialog_Announcement::OnBnClickedButton1()
8686

8787
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
8888

89-
st_JsonObject["tszContext"] = m_StrNotice.GetBuffer();
89+
st_JsonObject["tszContext"] = W2A(m_StrNotice.GetBuffer());
9090
st_JsonRoot["st_Notice"] = st_JsonObject;
9191
//是否加密
9292
XCHAR tszCodecBuffer[2048];

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Banned.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ void CDialog_Banned::OnBnClickedButton2()
129129
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
130130
if (BST_CHECKED == m_RadioUser.GetCheck())
131131
{
132-
st_JsonObject["tszUserName"] = m_StrUser.GetBuffer();
132+
st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer());
133133
}
134134
else
135135
{
136-
st_JsonObject["tszIPAddr"] = m_StrUser.GetBuffer();
136+
st_JsonObject["tszIPAddr"] = W2A(m_StrUser.GetBuffer());
137137
}
138138
if (BST_CHECKED == m_RadioEnable.GetCheck())
139139
{
@@ -145,7 +145,7 @@ void CDialog_Banned::OnBnClickedButton2()
145145
}
146146
if (BST_CHECKED == m_BtnCheckTime.GetCheck())
147147
{
148-
st_JsonObject["tszLeftTime"] = m_StrTime.GetBuffer();
148+
st_JsonObject["tszLeftTime"] = W2A(m_StrTime.GetBuffer());
149149
}
150150
st_JsonRoot["st_Banned"] = st_JsonObject;
151151
//是否加密
@@ -334,19 +334,20 @@ void CDialog_Banned::OnBnClickedButton3()
334334
Json::Value st_JsonRoot;
335335
Json::Value st_JsonObject;
336336
// TODO: 在此添加控件通知处理程序代码
337+
USES_CONVERSION;
337338
POSITION pSt_Sition = m_ListUser.GetFirstSelectedItemPosition();
338339
int nSelect = m_ListUser.GetNextSelectedItem(pSt_Sition);
339340
if (nSelect >= 0)
340341
{
341342
m_StrUser = m_ListUser.GetItemText(nSelect, 2);
342-
st_JsonObject["tszUserName"] = m_StrUser.GetBuffer();
343+
st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer());
343344
}
344345
pSt_Sition = m_ListAddr.GetFirstSelectedItemPosition();
345346
nSelect = m_ListAddr.GetNextSelectedItem(pSt_Sition);
346347
if (nSelect >= 0)
347348
{
348349
m_StrUser = m_ListAddr.GetItemText(nSelect, 2);
349-
st_JsonObject["tszIPAddr"] = m_StrUser.GetBuffer();
350+
st_JsonObject["tszIPAddr"] = W2A(m_StrUser.GetBuffer());
350351
}
351352
CString m_StrIPAddr;
352353
CString m_StrIPPort;
@@ -363,7 +364,6 @@ void CDialog_Banned::OnBnClickedButton3()
363364
st_JsonRoot["st_Banned"] = st_JsonObject;
364365
int nMsgLen = 0;
365366
XCHAR* ptszMsgBuffer = NULL;
366-
USES_CONVERSION;
367367
_xstprintf(tszUrlAddr, _X("http://%s:%s/auth/banned/delete"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer()));
368368
//是否加密
369369
TCHAR tszPassBuffer[64];
@@ -465,11 +465,11 @@ void CDialog_Banned::OnBnClickedButton5()
465465
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
466466
if (BST_CHECKED == m_RadioUser.GetCheck())
467467
{
468-
st_JsonObject["tszUserName"] = m_StrUser.GetBuffer();
468+
st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer());
469469
}
470470
else
471471
{
472-
st_JsonObject["tszIPAddr"] = m_StrUser.GetBuffer();
472+
st_JsonObject["tszIPAddr"] = W2A(m_StrUser.GetBuffer());
473473
}
474474
if (BST_CHECKED == m_RadioEnable.GetCheck())
475475
{
@@ -481,7 +481,7 @@ void CDialog_Banned::OnBnClickedButton5()
481481
}
482482
if (BST_CHECKED == m_BtnCheckTime.GetCheck())
483483
{
484-
st_JsonObject["tszLeftTime"] = m_StrTime.GetBuffer();
484+
st_JsonObject["tszLeftTime"] = W2A(m_StrTime.GetBuffer());
485485
}
486486
st_JsonRoot["st_Banned"] = st_JsonObject;
487487
//是否加密
@@ -565,7 +565,6 @@ void CDialog_Banned::OnNMClickList2(NMHDR* pNMHDR, LRESULT* pResult)
565565
}
566566
m_RadioIPAddr.SetCheck(BST_UNCHECKED);
567567
m_RadioUser.SetCheck(BST_CHECKED);
568-
569568
m_EditUser.SetWindowText(m_StrUser.GetBuffer());
570569
if (m_StrTime.GetLength() > 0)
571570
{

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Modify.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ BOOL CDialog_Modify::OnInitDialog()
9797
Json::Value st_JsonRoot;
9898
Json::Value st_JsonObject;
9999

100-
st_JsonObject["tszUserName"] = m_StrUser.GetBuffer();
100+
st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer());
101101
st_JsonRoot["st_UserInfo"] = st_JsonObject;
102102
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
103+
103104
//是否加密
104105
TCHAR tszPassBuffer[64];
105106
memset(tszPassBuffer, '\0', sizeof(tszPassBuffer));

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Serial.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,16 @@ void CDialog_Serial::OnBnClickedButton2()
204204
m_EditSerialCount.GetWindowText(m_StrSerialCount);
205205
m_ComboNumber.GetLBText(m_ComboNumber.GetCurSel(), m_StrNumberCount);
206206

207+
USES_CONVERSION;
207208
st_JsonObject["enSerialType"] = m_ComboSerialType.GetCurSel();
208209
st_JsonObject["nNumberCount"] = _ttoi(m_StrNumberCount.GetBuffer());
209210
st_JsonObject["nSerialCount"] = _ttoi(m_StrSerialCount.GetBuffer());
210-
st_JsonObject["tszHasTime"] = m_StrHasTime.GetBuffer();
211+
st_JsonObject["tszHasTime"] = W2A(m_StrHasTime.GetBuffer());
211212
st_JsonRoot["st_SerialInfo"] = st_JsonObject;
212213
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
213214

214215
int nMsgLen = 0;
215216
XCHAR* ptszMsgBuffer = NULL;
216-
USES_CONVERSION;
217217
_xstprintf(tszUrlAddr, _X("http://%s:%s/auth/serial/insert"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer()));
218218
//是否加密
219219
TCHAR tszPassBuffer[64];
@@ -305,15 +305,14 @@ void CDialog_Serial::OnBnClickedButton4()
305305
m_EditHasTime.GetWindowText(m_StrHasTime);
306306
m_EditSerialCount.GetWindowText(m_StrSerialCount);
307307
m_ComboNumber.GetLBText(m_ComboNumber.GetCurSel(), m_StrNumberCount);
308-
309-
st_JsonObject["tszSerialNumber"] = m_StrSerial.GetBuffer();
308+
USES_CONVERSION;
309+
st_JsonObject["tszSerialNumber"] = W2A(m_StrSerial.GetBuffer());
310310
st_JsonArray.append(st_JsonObject);
311311
st_JsonRoot["Array"] = st_JsonArray;
312312
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
313313

314314
int nMsgLen = 0;
315315
XCHAR* ptszMsgBuffer = NULL;
316-
USES_CONVERSION;
317316
_xstprintf(tszUrlAddr, _X("http://%s:%s/auth/serial/delete"), W2A(m_StrIPAddr.GetBuffer()), W2A(m_StrIPPort.GetBuffer()));
318317
//是否加密
319318
TCHAR tszPassBuffer[64];

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_Try.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ void CDialog_Try::OnBnClickedButton2()
192192
Json::Value st_JsonRoot;
193193
Json::Value st_JsonObject;
194194

195-
st_JsonObject["tszVSerial"] = m_StrSerial.GetBuffer();
195+
st_JsonObject["tszVSerial"] = W2A(m_StrSerial.GetBuffer());
196196
st_JsonRoot["st_VERTemp"] = st_JsonObject;
197197
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
198198
//是否加密
@@ -331,8 +331,8 @@ void CDialog_Try::OnBnClickedButton3()
331331
st_JsonObject["enVMode"] = (ENUM_AUTHORIZE_MODULE_SERIAL_TYPE)m_ComboType.GetCurSel();
332332
st_JsonObject["nVTime"] = _ttoi(m_StrTime.GetBuffer());
333333
st_JsonObject["nLTime"] = _ttoi(m_StrLeft.GetBuffer());
334-
st_JsonObject["tszVSerial"] = m_StrSerail.GetBuffer();
335-
st_JsonObject["tszVDate"] = m_StrDate.GetBuffer();
334+
st_JsonObject["tszVSerial"] = W2A(m_StrSerail.GetBuffer());
335+
st_JsonObject["tszVDate"] = W2A(m_StrDate.GetBuffer());
336336
st_JsonRoot["st_VERTemp"] = st_JsonObject;
337337
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
338338
//是否加密

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/Authorize_Dialog/Dialog_User.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void CDialog_User::OnBnClickedButton1()
183183
m_ListCtrlClient.SetItemText(i, 5, A2W(st_JsonArray["tszLeftTime"].asCString()));
184184
m_ListCtrlClient.SetItemText(i, 6, A2W(lpszXSerialType[st_JsonArray["enSerialType"].asInt()]));
185185
m_ListCtrlClient.SetItemText(i, 7, A2W(lpszXDevType[st_JsonArray["enDeviceType"].asInt()]));
186-
m_ListCtrlClient.SetItemText(i, 8, A2W(lpszStuType[st_JsonObject["nUserState"].asInt()]));
186+
m_ListCtrlClient.SetItemText(i, 8, lpszStuType[st_JsonObject["nUserState"].asInt()]);
187187
}
188188
BaseLib_Memory_FreeCStyle((XPPMEM)&ptszMsgBuffer);
189189
UpdateWindow();
@@ -218,7 +218,7 @@ void CDialog_User::OnBnClickedButton2()
218218
Json::Value st_JsonRoot;
219219
Json::Value st_JsonObject;
220220

221-
st_JsonObject["tszUserName"] = m_StrUser.GetBuffer();
221+
st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer());
222222
st_JsonRoot["st_UserInfo"] = st_JsonObject;
223223
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
224224

@@ -309,7 +309,7 @@ void CDialog_User::OnBnClickedButton3()
309309
Json::Value st_JsonRoot;
310310
Json::Value st_JsonObject;
311311

312-
st_JsonObject["tszUserName"] = m_StrUser.GetBuffer();
312+
st_JsonObject["tszUserName"] = W2A(m_StrUser.GetBuffer());
313313
st_JsonRoot["st_UserInfo"] = st_JsonObject;
314314
st_JsonRoot["xhToken"] = _ttoll(m_StrToken.GetBuffer());
315315
//是否加密

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ HWND hMainWnd = NULL;
77
HWND hUserWnd = NULL;
88
HWND hConfigWnd = NULL;
99
bool bCrypto = false;
10-
LPCXSTR lpszStuType[2] = { "离线","在线" };
10+
LPCTSTR lpszStuType[2] = { _T("离线"),_T("在线") };

XEngine_Source/XEngine_APPService/XEngine_AuthorizeApp/pch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extern HWND hMainWnd;
4747
extern HWND hUserWnd;
4848
extern HWND hConfigWnd;
4949
extern bool bCrypto;
50-
extern LPCXSTR lpszStuType[2];
50+
extern LPCTSTR lpszStuType[2];
5151

5252
#ifdef _DEBUG
5353
#ifdef _WIN64

0 commit comments

Comments
 (0)