H5 embedded nail micro-application map api call was not successful

vue.js
Code

is used to embed nails in

h5 pages for micro applications.

dd.ready(() => {
  alert(1)
  dd.device.geolocation.get({
    targetAccuracy: 200,
    coordinate: 1,
    withReGeocode: false,
    useCache:true,
    onSuccess:(result) => {
      alert(JSON.stringify(result) + "1")
    },
    onFail:(err) => {
      alert(JSON.stringify(err) + "2")
    }
  })
})

this is written in the mounted function
. First of all, dd.ready will pop up 1
if executed first, and then pop up the error message

directly.
{"errCode": "7", "jsapi": "jsapi should be invoked after  dd.ready callbacks"} 2

I don"t know if there is a problem or the other pop-up windows can be executed normally

Mar.20,2021

clipboard.png

dd.device.geolocation.get readyreadycallback



by default, only one script address reference is provided in the official document. After searching, it seems that there is no npm package.
in the vue project, how to use this jssdk in the page? If you use it directly, you can't get the callback of dd.ready all the time, so you don't know what configuration needs to be made?
Please let me know

.

1, first refer to the dingtalk.js file

of the nail globally.
<!-- -->
<script src="//g.alicdn.com/dingding/open-develop/1.6.9/dingtalk.js"></script>

2, then, this api method requires authentication , JSAPI permission verification configuration , whether the landlord has not been dd.config configuration

.

Authentication is required api Overview

Menu