Ver Fonte

修改地址key

lex há 2 anos atrás
pai
commit
c12c599350
2 ficheiros alterados com 15 adições e 1 exclusões
  1. 11 0
      index.html
  2. 4 1
      src/views/teacher-attendance/amap-gps.tsx

+ 11 - 0
index.html

@@ -42,6 +42,17 @@
 <body>
   <div id="app"></div>
   <script type="module" src="/src/main.ts"></script>
+  <script type="text/javascript">
+    // var url =  window.location.origin + '/_AMapService'
+    window._AMapSecurityConfig = {
+      serviceHost: 'https://online.dayaedu.com/_AMapService'
+    }
+
+      // window._AMapSecurityConfig = {
+      //     serviceHost: 'http://192.168.3.120:8001/_AMapService',
+      //     // 例如 :serviceHost:'http://1.1.1.1:80/_AMapService',
+      //   }
+  </script>
 </body>
 
 </html>

+ 4 - 1
src/views/teacher-attendance/amap-gps.tsx

@@ -40,8 +40,11 @@ export default defineComponent({
 
     const map = shallowRef<any>(null);
     const ininMap = () => {
+      // ac943ac1522de0d63eb8a99b71fe2601
+      // 501e5bfaf7cfc5d3d53a9a4d9466d8b9  9d8382171e90c8a085688172d7a903b2
+
       AMapLoader.load({
-        key: '501e5bfaf7cfc5d3d53a9a4d9466d8b9', //api服务key--另外需要在public中使用安全密钥!!!
+        key: 'ac943ac1522de0d63eb8a99b71fe2601', //api服务key--另外需要在public中使用安全密钥!!!
         version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
         plugins: [
           // 'AMap.AutoComplete', // 输入提示插件