Commit 07905508 by mingyuan

update js

parent 92f1eb89
import * as dd from 'dingtalk-jsapi'
const div = document.getElementById('dingding')
div.innerText = 'sssss'
dd.ready(() => {
dd.runtime.permission.requestAuthCode({
corpId: 'ding9f5ed2cec249700e35c2f4657eb6378f',
onSuccess(info) {
const div = document.getElementById('dingding')
div.innerText = info.code
console.log(info)
alert(info.code)
fetch(ele.href, {
method: method,
dd.device.notification.alert({
message: JSON.stringify(info),
buttonName: "收到"
})
fetch('https://soa-okr.tallty.com/dingtalk/apps/info', {
method: 'GET',
headers: {
Accept: 'text/vnd.turbo-stream.html'
Accept: 'application/json'
}
}).then(response => {
return response.text()
......@@ -20,19 +22,15 @@ dd.ready(() => {
})
},
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({
message: "测试",
title: "提示",//可传空
buttonName: "收到",
onSuccess : function() {
//onSuccess将在点击button之后回调
/*回调*/
},
onFail : function(err) {}
message: '测试',
buttonName: "收到"
})
})
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