diff --git a/src/adapter/chrome/manifest.json b/src/adapter/chrome/manifest.json index 84fa7471950eb9f68b56183db1ece18d6f235cba..c40196864361eb46f83618bb3f7acfab38f55420 100644 --- a/src/adapter/chrome/manifest.json +++ b/src/adapter/chrome/manifest.json @@ -6,32 +6,22 @@ "offline_enabled": true, "homepage_url": "https://github.com/baiy/Ctool", "manifest_version": 2, - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'", + "content_security_policy": "script-src 'self' 'unsafe-eval' https://www.baiy.org; object-src 'self'", "browser_action": { - "default_icon": "img/icon_chrome.png", + "default_icon": "img/icon128.png", "default_title": "常用开发工具", "default_popup": "index.html" }, - "default_locale": "zh_CN", - "background": { - "scripts": ["background.js"] - }, + "options_page": "setting.html", "icons": { - "16": "img/icon_chrome.png", - "48": "img/icon_chrome.png", - "128": "img/icon_chrome.png" + "16": "img/icon128.png", + "48": "img/icon128.png", + "128": "img/icon128.png" }, "permissions": [ "clipboardWrite", "clipboardRead", - "*://get.geojs.io/*", - "*://*.baiy.org/*" + "storage" ], - "commands": { - "panel": { - "description": "打开独立工具窗口", - "global": true - } - }, "update_url": "http://clients2.google.com/service/update2/crx" -} +} \ No newline at end of file diff --git a/src/views/tool/qrCode.vue b/src/views/tool/qrCode.vue index c815500fc6e8b7e9563be9d0b0fdea61eab8effb..d91ba2257849edc8e2474d0b7f2bcb34b46da868 100644 --- a/src/views/tool/qrCode.vue +++ b/src/views/tool/qrCode.vue @@ -21,18 +21,10 @@ - - 生成短连接 - - - 短链接API由 t.cn 提供 -
-

- 短连接:{{current.generateShortUrl}}

@@ -135,36 +127,14 @@ } let history = this.generateHistory.getValue(index) this.current.generateInput = history.input - this.current.generateIsShort = history.isShort this.generate(false) }, generate (insertHistory = true) { if (!this.current.generateInput) return - if (this.current.generateIsShort) { - if (!isUrl(this.current.generateInput)) { - return this.$Message.error('生成短连接的内容是url') - } - request({ - url: 'http://api.t.sina.com.cn/short_url/shorten.json', - data: { 'source': '2815391962', 'url_long': this.current.generateInput }, - }, (err, res, result) => { - if (err) return this.$Message.error('二维码短连接生成错误:' + err) - result = JSON.parse(result) - if (!result[0]['url_short']) { - return this.$Message.error('短连接生成错误') - } else { - this.current.generateShortUrl = result[0]['url_short'] - this.generateHandle(this.current.generateShortUrl) - } - }) - } else { - this.current.generateShortUrl = '' - this.generateHandle(this.current.generateInput) - } + this.generateHandle(this.current.generateInput) if (insertHistory) { this.generateHistory.push({ - input: this.current.generateInput, - isShort: this.current.generateIsShort, + input: this.current.generateInput }) } this.$saveToolData(this.current)