From a19586079b510f6bdb0fdd69da5b1f7b0e399f2b Mon Sep 17 00:00:00 2001 From: baiy Date: Thu, 9 Jul 2020 11:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dip=E6=9F=A5=E8=AF=A2=20?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 2 +- public/tool.html | 2 +- src/adapter/chrome/manifest.json | 4 +++- src/views/tool/ip.vue | 26 ++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 703cb66..72a7761 100644 --- a/public/index.html +++ b/public/index.html @@ -16,7 +16,7 @@ -
+
加载中...
diff --git a/public/tool.html b/public/tool.html index 1bac150..c1e2605 100644 --- a/public/tool.html +++ b/public/tool.html @@ -7,7 +7,7 @@ Ctool 程序开发常用工具 -
+
diff --git a/src/adapter/chrome/manifest.json b/src/adapter/chrome/manifest.json index c401968..d003b30 100644 --- a/src/adapter/chrome/manifest.json +++ b/src/adapter/chrome/manifest.json @@ -21,7 +21,9 @@ "permissions": [ "clipboardWrite", "clipboardRead", - "storage" + "webRequest", + "storage", + "http://ip.taobao.com/*" ], "update_url": "http://clients2.google.com/service/update2/crx" } \ No newline at end of file diff --git a/src/views/tool/ip.vue b/src/views/tool/ip.vue index 025b49f..fa7d25e 100644 --- a/src/views/tool/ip.vue +++ b/src/views/tool/ip.vue @@ -26,6 +26,7 @@ import codeEditor from "./components/codeEditor"; import jsonFormatter from "./library/formatter/json"; import heightResize from "./components/heightResize"; +<<<<<<< HEAD export default { components: { codeEditor, @@ -54,6 +55,31 @@ export default { this.$t('ip_error', [error.message]).toString() ) }); +======= + export default { + created() { + this.current = Object.assign(this.current,this.$getToolData("input")) + }, + methods: { + handle() { + if (this.current.input) { + request({ + url:"http://ip.taobao.com/outGetIpInfo", + data:{ + "ip":this.current.input === "localhost" ? 'myip' : this.current.input, + "accessKey": "alibaba-inc" + }, + },(err, res, result)=>{ + if (err) return this.$Message.error("ip地址信息查询错误:"+err); + this.current.output = JSON.stringify(JSON.parse(result),null, 4); + this.$saveToolData(this.current); + }); + } + }, + local(){ + this.current.input = 'localhost'; + this.handle() +>>>>>>> 3e57baf... 修复ip查询 } }, local() { -- GitLab