Commit 07905508 by mingyuan

update js

parent 92f1eb89
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) {}
}) })
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment