Jelajahi Sumber

增加app接口

shs 1 tahun lalu
induk
melakukan
349c2c95e9

+ 2 - 2
aidex-admin/src/main/resources/application.yml

@@ -123,9 +123,9 @@ pagehelper:
 # Swagger配置
 swagger:
   # 是否开启swagger
-  enabled: true
+  enabled: false
   # 请求前缀
-  pathMapping: /dev-api
+  pathMapping: /api
 
 # 防止XSS攻击
 xss:

+ 2 - 2
aidex-admin/target/classes/application.yml

@@ -123,9 +123,9 @@ pagehelper:
 # Swagger配置
 swagger:
   # 是否开启swagger
-  enabled: true
+  enabled: false
   # 请求前缀
-  pathMapping: /dev-api
+  pathMapping: /api
 
 # 防止XSS攻击
 xss:

+ 20 - 0
aidex-controller/src/main/java/com/aidex/web/controller/app/AppController.java

@@ -0,0 +1,20 @@
+package com.aidex.web.controller.app;
+
+
+import com.aidex.common.core.domain.R;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+@RestController
+@RequestMapping("/app")
+public class AppController {
+
+
+    @GetMapping("/test")
+    public R<String> test()
+    {
+        return R.data("success");
+    }
+}

+ 1 - 0
aidex-framework/src/main/java/com/aidex/framework/config/SecurityConfig.java

@@ -148,6 +148,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
                 .antMatchers("/webjars/**").anonymous()
                 .antMatchers("/*/api-docs").anonymous()
                 .antMatchers("/druid/**").anonymous()
+                .antMatchers("/app/*").anonymous()
                 .antMatchers(anonymousUrls.toArray(new String[0])).anonymous()
                 // 除上面外的所有请求全部需要鉴权认证
                 .anyRequest().authenticated()

TEMPAT SAMPAH
aidex-framework/target/classes/com/aidex/framework/config/SecurityConfig.class


+ 23 - 1
aidex-ui/src/views/operation/location/index.vue

@@ -17,7 +17,14 @@
             <h2>{{ selShipData.shipNanme }}-实时位置</h2>
           </div>
           <a-divider />
-          <iframe width="100%" style="border: none; height: calc(100% - 65px)" :src="gpsLocalUrl"></iframe>
+          <iframe
+            frameborder="0"
+            id="locationIframe"
+            onload="load()"
+            width="100%"
+            style="border: none; height: calc(100% - 65px)"
+            name="ha-main-window"
+            src="http://localhost//user/tracking.html?lang=cn&loginUrl=&requestSource=web&custname=BBZ-01476417&school_id=e63b1e42-172d-42d6-872c-3bc66bbc6e2f&mapType=QQ&custid=e63b1e42-172d-42d6-872c-3bc66bbc6e2f&mds=f685207ebaab46448689c92503043a3d&objectid=f9e21a32-dd6b-4c3d-89a8-227677c91104&r=-1710497635" ></iframe>
         </template>
       </split>
     </a-card>
@@ -29,6 +36,13 @@ import { listAllSysShip } from '@/api/system/sysShip'
 import { location } from '@/api/gps/gps'
 import ShipTree from './modules/ShipTree'
 import Split from '@/components/pt/split/Index'
+// document.domain = 'www.18gps.net'
+function load() {
+    iframe.contentWindow.postMessage('定位', 'http://localhost')
+    window.onmessage = e => {
+      console.log(e.data)
+    }
+  }
 export default {
   name: 'User',
   components: {
@@ -60,6 +74,14 @@ export default {
     getLocation() {
       location({ shipId: this.selShipData.id }).then(res => {
         this.gpsLocalUrl = res.data
+        // const data = {
+        //   method: 'Follow',
+        //   macid: '19171476417',
+        //   mapType: 'QQ',
+        //   mds: 'f685207ebaab46448689c92503043a3d',
+        //   url: 'http://www.18gps.net/'
+        // }
+        // document.getElementById('locationIframe').contentWindow.postMessage(data, '*')
       })
     },
     clickNode(node) {