|
|
@@ -252,7 +252,22 @@ export default {
|
|
|
}
|
|
|
this.scanProcessing = true
|
|
|
this.showScanPopup = false
|
|
|
- this.navigateByScanContent(content.trim())
|
|
|
+ this.navigateByScanContent(this.normalizeScanContent(content.trim()))
|
|
|
+ },
|
|
|
+ normalizeScanContent(content) {
|
|
|
+ if (/^http:\/\//i.test(content)) {
|
|
|
+ return content.replace(/^http:\/\//i, 'https://')
|
|
|
+ }
|
|
|
+ if (/^https:\/\//i.test(content)) {
|
|
|
+ return content
|
|
|
+ }
|
|
|
+ if (content.indexOf('/') === 0) {
|
|
|
+ return content
|
|
|
+ }
|
|
|
+ if (/^(www\.|[\w-]+(\.[\w-]+)+)(:\d+)?(\/|$)/i.test(content)) {
|
|
|
+ return 'https://' + content
|
|
|
+ }
|
|
|
+ return content
|
|
|
},
|
|
|
navigateByScanContent(content) {
|
|
|
const isFullUrl = /^https?:\/\//i.test(content)
|