Skip to content

Commit

Permalink
Merge pull request #17 from wanglong126/master
Browse files Browse the repository at this point in the history
update 如果剪切板内容是网址,构造GET请求 #16
  • Loading branch information
fffguo authored Aug 19, 2022
2 parents 3dd7f36 + 0a25a3e commit 7aa6256
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/CurlLocalRequest/CurlLocalRequest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,19 @@ export default {
}
},
methods: {},
methods: {
isURL(s) {
return /^https?:\/\//.test(s)
}
},
mounted() {
window.utools.onPluginEnter(({code, type, payload}) => {
console.log('用户进入插件', code, type, payload)
this.$store.state.curl.curlText = payload
let curl = CURLParser(payload);
if(curl===undefined &&this.isURL(payload)){
curl= {method: 'GET', url: payload, header: {}, body: ''};
}
console.log("curl:", curl)
//初始化
this.$store.commit('initByCurlText', curl);
Expand Down

0 comments on commit 7aa6256

Please sign in to comment.