Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CaliBetManagementSystem
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BruceLu
CaliBetManagementSystem
Commits
5d32bcf1
Commit
5d32bcf1
authored
Sep 17, 2023
by
BruceLu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token不會過期,註解掉程式碼
parent
3c42a62b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
CaliBetManagementSystem/Program.cs
+6
-5
No files found.
CaliBetManagementSystem/Program.cs
View file @
5d32bcf1
...
@@ -57,7 +57,8 @@ internal class Program
...
@@ -57,7 +57,8 @@ internal class Program
{
{
JObject
jObject
=
new
JObject
();
JObject
jObject
=
new
JObject
();
jObject
[
"username"
]
=
_username
=
username
;
jObject
[
"username"
]
=
_username
=
username
;
jObject
[
"password"
]
=
_password
=
password
.
ToMD5
(
username
);
_password
=
password
;
jObject
[
"password"
]
=
password
.
ToMD5
(
username
);
jObject
[
"refer"
]
=
"https://ams.cali9999.net/"
;
jObject
[
"refer"
]
=
"https://ams.cali9999.net/"
;
var
res
=
_httpClient
.
PostAsync
(
$"https://ams.cali9999.net/service/auth?t=
{
DateTime
.
Now
.
Millisecond
}
"
,
new
StringContent
(
JsonConvert
.
SerializeObject
(
jObject
),
Encoding
.
UTF8
,
"application/json"
)).
Result
;
var
res
=
_httpClient
.
PostAsync
(
$"https://ams.cali9999.net/service/auth?t=
{
DateTime
.
Now
.
Millisecond
}
"
,
new
StringContent
(
JsonConvert
.
SerializeObject
(
jObject
),
Encoding
.
UTF8
,
"application/json"
)).
Result
;
if
(
res
.
IsSuccessStatusCode
)
if
(
res
.
IsSuccessStatusCode
)
...
@@ -107,12 +108,12 @@ internal class Program
...
@@ -107,12 +108,12 @@ internal class Program
{
{
var
totalContent
=
JsonConvert
.
DeserializeObject
<
JObject
>(
res
.
Content
.
ReadAsStringAsync
().
Result
);
var
totalContent
=
JsonConvert
.
DeserializeObject
<
JObject
>(
res
.
Content
.
ReadAsStringAsync
().
Result
);
//判斷token有沒有過期
//判斷token有沒有過期
if
(
totalContent
[
"resultCode"
]
is
not
null
&&
(
int
)
totalContent
[
"resultCode"
]
!=
0
)
/*
if (totalContent["resultCode"] is not null && (int)totalContent["resultCode"] != 0)
{
{
Login(_username, _password);
Login(_username, _password);
GetWinLoss(startTime, endTime, pageNum, numPerPage);
GetWinLoss(startTime, endTime, pageNum, numPerPage);
return;
return;
}
}
*/
var
info
=
totalContent
[
"data"
][
"total"
].
ToObject
<
WinLossSummary
>();
var
info
=
totalContent
[
"data"
][
"total"
].
ToObject
<
WinLossSummary
>();
if
(
info
!=
null
)
if
(
info
!=
null
)
...
@@ -127,12 +128,12 @@ internal class Program
...
@@ -127,12 +128,12 @@ internal class Program
{
{
var
agentContent
=
JsonConvert
.
DeserializeObject
<
JObject
>(
res
.
Content
.
ReadAsStringAsync
().
Result
);
var
agentContent
=
JsonConvert
.
DeserializeObject
<
JObject
>(
res
.
Content
.
ReadAsStringAsync
().
Result
);
//判斷token有沒有過期
//判斷token有沒有過期
if
(
agentContent
[
"resultCode"
]
is
not
null
&&
(
int
)
agentContent
[
"resultCode"
]
!=
0
)
/*
if (agentContent["resultCode"] is not null && (int)agentContent["resultCode"] != 0)
{
{
Login(_username, _password);
Login(_username, _password);
GetWinLoss(startTime, endTime, pageNum, numPerPage);
GetWinLoss(startTime, endTime, pageNum, numPerPage);
return;
return;
}
}
*/
if
(
agentContent
[
"data"
][
"agentDetails"
][
"groups"
]
!=
null
)
if
(
agentContent
[
"data"
][
"agentDetails"
][
"groups"
]
!=
null
)
{
{
foreach
(
var
item
in
agentContent
[
"data"
][
"agentDetails"
][
"groups"
])
foreach
(
var
item
in
agentContent
[
"data"
][
"agentDetails"
][
"groups"
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment