|
|
|
@ -3,8 +3,11 @@ |
|
|
|
|
|
|
|
<div class="wfbox"> |
|
|
|
<div class="wfso"> |
|
|
|
<form @submit.prevent="sofile"> |
|
|
|
<input class="wfinput" type="text" ref="sokey" placeholder="请输入文件路径" v-model="spath"> |
|
|
|
<button class="wfbtn" @click="sofile()">GO</button> |
|
|
|
<button class="wfbtn" type="submit" >GO</button> |
|
|
|
</form> |
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="fbox"> |
|
|
|
<div class="ftit"> |
|
|
|
@ -63,8 +66,17 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
sofile(){ |
|
|
|
// alert("soobtn") |
|
|
|
this.spath = this.$refs.sokey.value |
|
|
|
let key = this.$refs.sokey.value |
|
|
|
// 正则判断是否包含../ 或 .. |
|
|
|
|
|
|
|
let reg = /\.\.\// |
|
|
|
if(reg.test(key)){ |
|
|
|
// 正则替换 |
|
|
|
key = key.replace(/\.\.\//g, '') |
|
|
|
// return false; |
|
|
|
} |
|
|
|
this.$refs.sokey.value = key |
|
|
|
// this.spath = this.$refs.sokey.value |
|
|
|
this.getFlist() |
|
|
|
} |
|
|
|
} |
|
|
|
|