Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
5b256362
Commit
5b256362
authored
Jan 28, 2023
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token查询
parent
df2231ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
144 additions
and
77 deletions
+144
-77
token.html
...n-manage3-operation-web/src/main/webapp/static/token.html
+144
-77
No files found.
haoban-manage3-operation-web/src/main/webapp/static/token.html
View file @
5b256362
...
@@ -4,11 +4,10 @@
...
@@ -4,11 +4,10 @@
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
计划
</title>
<title>
token
</title>
<link
href=
"css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"css/bootstrap.min.css"
rel=
"stylesheet"
>
<script
src=
"js/jquery.min.js"
></script>
<script
src=
"js/jquery.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://res.wx.qq.com/open/js/jweixin-1.3.2.js"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
Date
.
prototype
.
format
=
function
(
fmt
)
{
Date
.
prototype
.
format
=
function
(
fmt
)
{
...
@@ -27,104 +26,172 @@ Date.prototype.format = function (fmt) {
...
@@ -27,104 +26,172 @@ Date.prototype.format = function (fmt) {
return
fmt
;
return
fmt
;
}
}
var
dateNum
=
1
;
var
endDate
=
new
Date
();
var
host
=
""
;
var
map
=
{
"wwb3ef71aa8c6d9c06"
:
"好办小程序"
,
"wwe93faef4ade602f3"
:
"好办小程序"
,
"wwb6d087b222b00c2b"
:
"好办小程序"
,
"dkfe6f9c300b71ad72"
:
"好办助手"
,
"dk2d2f5784ad473bbc"
:
"好办助手"
,
"dk6467c452ecf5de90"
:
"好办助手"
,
"dkf217f8ce8f4a57a7"
:
"会员工具1"
,
"dk695e5faedeb5f0fe"
:
"会员工具2"
,
"dkee8e7a1bd2a0f891"
:
"会员工具"
,
"dk2c6d3af12ca5e23c"
:
"会员工具1"
,
"dkd83fb7d63e4be90a"
:
"会员工具2"
,
"dkf3279730ec018a30"
:
"会员工具3"
,
"dk86053fba94689927"
:
"会员工具4"
,
"dke7166a8a3ce18170"
:
"会员工具5"
,
"dkfa2218da968c7433"
:
"会员工具6"
,
"dkf85ba8bb7cefe901"
:
"会员工具7"
,
"dkdf2a983a28faf860"
:
"会员工具8"
}
function
search
(
retData
)
{
var
host
=
""
;
function
referData
(
retData
,
tokenType
)
{
$
(
"#tb_teletext"
).
html
(
""
);
$
(
"#tb_teletext"
).
html
(
""
);
var
htm
=
""
;
var
htm
=
""
;
if
(
!
retData
.
result
||
!
retData
.
result
.
result
||
retData
.
result
.
result
.
length
==
0
)
{
if
(
!
retData
.
result
||
retData
.
result
.
length
==
0
)
{
alert
(
"无数据"
)
alert
(
"无数据"
)
return
;
return
;
}
}
for
(
var
i
=
0
;
i
<
retData
.
result
.
result
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
retData
.
result
.
length
;
i
++
)
{
var
item
=
retData
.
result
.
result
[
i
]
;
var
item
=
retData
.
result
[
i
]
;
var
eid
=
item
.
enterpriseId
;
var
corpid
=
item
.
corpid
;
var
createTime
=
new
Date
(
item
.
createTime
).
format
(
"yyyy-MM-dd hh:mm:ss"
);
var
suiteId
=
item
.
suiteId
;
var
sendTime
=
new
Date
(
item
.
executeTime
).
format
(
"yyyy-MM-dd hh:mm:ss"
);
var
id
=
""
;
var
list
=
item
.
itemList
;
var
name
=
""
;
var
title
=
item
.
planName
;
var
accessToken
=
""
;
htm
+=
'<tr class="info"><td>'
+
item
.
enterpriseName
+
"("
+
eid
+
")"
+
'</td><td>'
+
createTime
+
'</td><td>'
+
sendTime
+
'</td><td>'
+
title
+
'</td><td>'
+
item
.
preCount
+
'</td><td>'
+
item
.
sendCont
+
'</td></tr>'
;
var
time1
=
0
;
}
var
secret
=
""
;
$
(
"#tb_teletext"
).
html
(
htm
);
if
(
tokenType
==
1
)
{
id
=
item
.
corpid
;
name
=
"服务商"
;
accessToken
=
item
.
accessToken
;
time
=
item
.
updateTokenTimestamp
;
}
if
(
tokenType
==
2
)
{
id
=
item
.
suiteId
;
if
(
id
==
'selfSuiteId'
||
id
==
'contactSuiteId'
)
{
continue
;
}
name
=
"应用"
;
if
(
map
[
id
])
{
name
=
map
[
id
]
;
}
accessToken
=
item
.
suiteAccessToken
;
time
=
item
.
updateAccessTokenTimestamp
;
}
if
(
tokenType
==
3
)
{
id
=
item
.
suiteId
;
name
=
item
.
corpName
+
"<br/>"
+
map
[
id
]
;
accessToken
=
item
.
accessToken
;
time
=
item
.
updateAccessTokenTimestamp
;
if
(
item
.
isCustomizedApp
==
1
)
{
secret
=
item
.
permanentCode
;
}
}
var
timeX
=
'--'
;
if
(
time
)
{
timeX
=
new
Date
(
parseInt
(
time
)).
format
(
"yyyy-MM-dd hh:mm:ss"
);
}
var
btn1
=
"<button data-secret='"
+
secret
+
"' data-corpid='"
+
corpid
+
"' data-suiteid='"
+
suiteId
+
"' onclick='reflushToken("
+
tokenType
+
",this)'>刷新</button>"
var
btn2
=
"<button data-secret='"
+
secret
+
"' data-corpid='"
+
corpid
+
"' data-suiteid='"
+
suiteId
+
"' onclick='getCacheToken("
+
tokenType
+
",this)'>查询cache</button>"
var
btns
=
btn1
+
btn2
;
htm
+=
'<tr class="info"><td>'
+
id
+
'</td><td>'
+
name
+
'</td><td title="'
+
accessToken
+
'" style="white-space:nowrap;overflow: hidden;text-overflow:ellipsis">'
+
accessToken
+
'</td><td>'
+
timeX
+
'</td><td>'
+
btns
+
'</td></tr>'
;
}
$
(
"#tb_teletext"
).
html
(
htm
);
}
}
function
coupon
()
{
function
reflushToken
(
tokenType
,
o
)
{
$
.
ajax
({
var
corpid
=
$
(
o
).
attr
(
"data-corpid"
)
;
type
:
"post"
,
var
suiteid
=
$
(
o
).
attr
(
"data-suiteid"
)
;
url
:
host
+
'/marketing-operation/plan/card-statistics?pageSize=1000&endTime='
+
endDate
,
var
url
=
host
+
'/gic/weixin3th/qywx-token/reflush-token?tokenType='
+
tokenType
+
'&corpid='
+
corpid
;
success
:
function
(
retData
)
{
if
(
tokenType
==
2
)
{
search
(
retData
)
url
=
host
+
'/gic/weixin3th/qywx-token/reflush-token?tokenType='
+
tokenType
+
'&suiteId='
+
suiteid
}
}
});
if
(
tokenType
==
3
)
{
}
url
=
host
+
'/gic/weixin3th/qywx-token/reflush-token?tokenType='
+
tokenType
+
'&suiteId='
+
suiteid
+
'&corpid='
+
corpid
;
}
function
ecm
()
{
$
.
ajax
({
$
.
ajax
({
type
:
"post"
,
type
:
"post"
,
url
:
host
+
'/marketing-operation/plan/ecm-statistics?pageSize=1000&endTime='
+
endDate
,
url
:
url
,
success
:
function
(
retData
)
{
success
:
function
(
retData
)
{
search
(
retData
)
alert
(
"刷新成功"
)
;
}
}
});
});
}
}
function
sms
()
{
$
.
ajax
({
function
getCacheToken
(
tokenType
,
o
)
{
var
corpid
=
$
(
o
).
attr
(
"data-corpid"
)
;
var
suiteid
=
$
(
o
).
attr
(
"data-suiteid"
)
;
var
secret
=
$
(
o
).
attr
(
"data-secret"
)
;
var
url
=
host
+
'/gic/weixin3th/qywx-token/get-cache-token?tokenType='
+
tokenType
+
'&corpid='
+
corpid
;
if
(
tokenType
==
2
)
{
url
=
host
+
'/gic/weixin3th/qywx-token/get-cache-token?tokenType='
+
tokenType
+
'&suiteId='
+
suiteid
}
if
(
tokenType
==
3
)
{
url
=
host
+
'/gic/weixin3th/qywx-token/get-cache-token?tokenType='
+
tokenType
+
'&suiteId='
+
suiteid
+
'&corpid='
+
corpid
+
'&secret='
+
secret
;
}
$
.
ajax
({
type
:
"post"
,
type
:
"post"
,
url
:
host
+
'/marketing-operation/plan/sms-statistics?pageSize=1000&endTime='
+
endDate
,
url
:
url
,
success
:
function
(
retData
)
{
success
:
function
(
retData
)
{
search
(
retData
)
alert
(
retData
.
result
)
;
}
}
});
});
}
}
function
ai
()
{
function
corpidToken
()
{
var
corpids
=
$
(
"#corpids"
).
val
()
;
if
(
!
corpids
)
{
alert
(
"请输入corpid"
)
;
return
;
}
$
.
ajax
({
type
:
"post"
,
url
:
host
+
'/gic/weixin3th/qywx-token/list-token?corpids='
+
corpids
,
success
:
function
(
retData
)
{
referData
(
retData
,
3
)
;
}
});
}
$
.
ajax
({
function
suiteToken
()
{
type
:
"post"
,
$
.
ajax
({
url
:
host
+
'/marketing-operation/plan/ai-statistics?pageSize=1000&endTime='
+
endDate
,
type
:
"post"
,
success
:
function
(
retData
)
{
url
:
host
+
'/gic/weixin3th/qywx-token/list-suite'
,
search
(
retData
)
success
:
function
(
retData
)
{
}
referData
(
retData
,
2
)
;
}
});
});
}
}
function
dateType
(
num
,
obj
)
{
function
provideToken
()
{
dateNum
=
num
-
1
;
$
.
ajax
({
$
(
".btn"
).
css
(
"color"
,
"black"
)
;
type
:
"post"
,
$
(
obj
).
css
(
"color"
,
"red"
)
;
url
:
host
+
'/gic/weixin3th/qywx-token/list-provider'
,
success
:
function
(
retData
)
{
referData
(
retData
,
1
)
;
if
(
dateNum
<
15
)
{
}
endDate
=
new
Date
((
new
Date
()
/
1000
+
(
86400
*
dateNum
))
*
1000
).
format
(
"yyyy-MM-dd 23:59:59"
);
//增加n天后的日期
});
/* alert(endDate); */
}
}
}
</script>
</script>
</head>
</head>
<body>
<body>
<div
class=
"container"
id=
"couponDiv"
>
<div
class=
"container"
id=
"couponDiv"
>
<div
class=
"tab-pane"
id=
"tab2"
style=
"padding:5px"
>
<div
class=
"tab-pane"
id=
"tab2"
style=
"padding:5px"
>
<h2>
<button
onclick=
"corpidToken()"
>
企业应用token(access-token)
</button>
<button
onclick=
"dateType(1,this)"
class=
"btn"
>
当天
</button>
<button
onclick=
"suiteToken()"
>
好办应用token(suite-access-token)
</button>
<button
onclick=
"dateType(2,this)"
class=
"btn"
>
近2天
</button>
<button
onclick=
"provideToken()"
>
服务商token
</button>
<button
onclick=
"dateType(7,this)"
class=
"btn"
>
近7天
</button>
<br/>
</h2>
<div
style=
"padding:2px 2px"
>
corpid,多个","号分割:
<input
id=
"corpids"
style=
"width:600px"
>
<button
onclick=
"coupon()"
>
卡券
</button>
<br/>
<button
onclick=
"ecm()"
>
ECM
</button>
</div>
<button
onclick=
"sms()"
>
短信
</button>
<table
class=
"table table-bordered"
style=
"table-layout: fixed;"
>
<button
onclick=
"ai()"
>
AI
</button>
<thead><tr><th>
ID
</th><th>
名称
</th><th>
access_token
</th><th>
最新更新时间
</th><th>
操作
</th></tr></thead>
<table
class=
"table table-bordered"
>
<thead><tr><th>
商户
</th><th>
创建时间
</th><th>
发送时间
</th><th>
计划名称
</th><th>
预计人数
</th><th>
发送人数
</th></tr></thead>
<tbody
id=
"tb_teletext"
>
<tbody
id=
"tb_teletext"
>
</tbody>
</tbody>
</table>
</table>
...
...
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