From 5f5cce623647f323c90c16428b5c46f5769c51af Mon Sep 17 00:00:00 2001 From: chaiyapeng <3535863041@qq.com> Date: Thu, 29 Aug 2024 21:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E9=97=BB=E5=A4=B4=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/port/port/index.js | 13 ++++++ src/views/port/port/employee.vue | 73 ++++++++++++++++++++++++++------ 2 files changed, 73 insertions(+), 13 deletions(-) diff --git a/src/api/port/port/index.js b/src/api/port/port/index.js index 6cf4f3d..90d4a0f 100644 --- a/src/api/port/port/index.js +++ b/src/api/port/port/index.js @@ -37,3 +37,16 @@ export function phonePlace(tel) { method: 'GET' }) } + +export function getIpPlace(ip) { + return request({ + url: '/port/list/getIpPlace?ip='+ip, + method: 'GET' + }) +} +export function getHeadlines() { + return request({ + url: '/port/list/getHeadlines', + method: 'GET' + }) +} diff --git a/src/views/port/port/employee.vue b/src/views/port/port/employee.vue index eeb76f5..1792b22 100644 --- a/src/views/port/port/employee.vue +++ b/src/views/port/port/employee.vue @@ -15,8 +15,8 @@ {{connector.connectorPrice}}/次
测试API - 测试 - 测试 + 测试API + 测试API 测试 测试 测试 @@ -27,7 +27,7 @@ - + 省份:{{this.formInline.province}}
@@ -44,22 +44,30 @@ - - - + + + - - 省份:{{this.formInline.province}}
- 城市:{{this.formInline.city}}
- 区号:{{this.formInline.areacode}}
- 邮编:{{this.formInline.zip}}
- 运营商:{{this.formInline.company}}
+ + 国家:{{this.formIp.country}}
+ 省份:{{this.formIp.province}}
+ 城市:{{this.formIp.city}}
+ 运营商:{{this.formIp.isp}}
+ + + + + + + + + @@ -69,6 +77,8 @@ import {findConnectorList} from "@/api/port/port"; import index from "vuex"; import {phonePlace} from "@/api/port/port"; +import {getIpPlace} from "@/api/port/port"; +import {getHeadlines} from "@/api/port/port"; export default { //import引入的组件需要注入到对象中才能使用" components: {}, @@ -78,6 +88,7 @@ export default { return { connectorList:[], + gridData:[], form:{}, // 手机号查询归属地formInline formInline:{ @@ -89,9 +100,23 @@ export default { company:"", reason:"", }, + + formIp:{ + ip:"", + country:"", + province:"", + city:"", + isp:"", + reason:"", + }, + formNews:{ + news:"", + reason:"", + }, // IP查询归属地 dialogFormVisible:false, dialogFormVisible1:false, + dialogTableVisible:false, }; }, //计算属性 类似于data概念", @@ -107,6 +132,28 @@ export default { watch: {}, //方法集合", methods: { + testNews(){ + getHeadlines().then((res)=>{ + this.gridData=res.data; + this.dialogTableVisible=true; + }) + }, + getIpPlace(){ + getIpPlace(this.formIp.ip).then((res)=>{ + console.log(res.data); + if (200==res.code){ + this.formIp.country=res.data.country; + this.formIp.province=res.data.province; + this.formIp.city=res.data.city; + this.formIp.isp=res.data.isp; + this.formIp.reason=true; + } + }) + }, + testIP(ip){ + this.formIp.ip=ip; + this.dialogFormVisible1=true; + }, testPhone(tel){ this.formInline.tel=tel; this.dialogFormVisible=true;