Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rails_dingtalk
Project
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
other
rails_dingtalk
Commits
07905508
Commit
07905508
authored
Sep 05, 2021
by
mingyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update js
parent
92f1eb89
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
index.js
app/views/dingtalk/home/index.js
+16
-18
No files found.
app/views/dingtalk/home/index.js
View file @
07905508
import
*
as
dd
from
'dingtalk-jsapi'
import
*
as
dd
from
'dingtalk-jsapi'
const
div
=
document
.
getElementById
(
'dingding'
)
div
.
innerText
=
'sssss'
dd
.
ready
(()
=>
{
dd
.
ready
(()
=>
{
dd
.
runtime
.
permission
.
requestAuthCode
({
dd
.
runtime
.
permission
.
requestAuthCode
({
corpId
:
'ding9f5ed2cec249700e35c2f4657eb6378f'
,
corpId
:
'ding9f5ed2cec249700e35c2f4657eb6378f'
,
onSuccess
(
info
)
{
onSuccess
(
info
)
{
const
div
=
document
.
getElementById
(
'dingding'
)
div
.
innerText
=
info
.
code
div
.
innerText
=
info
.
code
console
.
log
(
info
)
dd
.
device
.
notification
.
alert
({
alert
(
info
.
code
)
message
:
JSON
.
stringify
(
info
),
fetch
(
ele
.
href
,
{
buttonName
:
"收到"
method
:
method
,
})
fetch
(
'https://soa-okr.tallty.com/dingtalk/apps/info'
,
{
method
:
'GET'
,
headers
:
{
headers
:
{
Accept
:
'
text/vnd.turbo-stream.html
'
Accept
:
'
application/json
'
}
}
}).
then
(
response
=>
{
}).
then
(
response
=>
{
return
response
.
text
()
return
response
.
text
()
...
@@ -20,19 +22,15 @@ dd.ready(() => {
...
@@ -20,19 +22,15 @@ dd.ready(() => {
})
})
},
},
onFail
(
res
)
{
onFail
(
res
)
{
alert
(
'dd error: '
+
JSON
.
stringify
(
res
))
div
.
innerText
=
JSON
.
stringify
(
res
)
dd
.
device
.
notification
.
alert
({
message
:
JSON
.
stringify
(
res
),
buttonName
:
"报错"
})
}
}
})
})
dd
.
device
.
notification
.
alert
({
dd
.
device
.
notification
.
alert
({
message
:
"测试"
,
message
:
'测试'
,
title
:
"提示"
,
//可传空
buttonName
:
"收到"
buttonName
:
"收到"
,
onSuccess
:
function
()
{
//onSuccess将在点击button之后回调
/*回调*/
},
onFail
:
function
(
err
)
{}
})
})
})
})
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