【modify】使用ESLint格式化代码
This commit is contained in:
@@ -35,58 +35,57 @@
|
||||
</a-card>
|
||||
</template>
|
||||
<script>
|
||||
import { axios } from '@/utils/request'
|
||||
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||
import Vue from 'vue'
|
||||
export default {
|
||||
name: 'FlowTest',
|
||||
data(){
|
||||
return {
|
||||
url:"",
|
||||
paramJson:"",
|
||||
resultJson:{},
|
||||
requestMethod:"POST"
|
||||
import { axios } from '@/utils/request'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import Vue from 'vue'
|
||||
export default {
|
||||
name: 'FlowTest',
|
||||
data () {
|
||||
return {
|
||||
url: '',
|
||||
paramJson: '',
|
||||
resultJson: {},
|
||||
requestMethod: 'POST'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSearch (value) {
|
||||
const that = this
|
||||
if (!value) {
|
||||
that.$message.error('请填写路径')
|
||||
return false
|
||||
}
|
||||
this.resultJson = {}
|
||||
axios({
|
||||
url: value,
|
||||
method: this.requestMethod,
|
||||
data: this.paramJson
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.resultJson = res
|
||||
}).catch((err) => {
|
||||
that.$message.error('请求异常:' + err)
|
||||
})
|
||||
},
|
||||
changeVal (e) {
|
||||
try {
|
||||
let json = e.target.value
|
||||
if (json.indexOf(',}') > 0) {
|
||||
json = json.replace(',}', '}')
|
||||
}
|
||||
this.paramJson = JSON.parse(json)
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
this.$message.error('非法的JSON字符串')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSearch (value) {
|
||||
let that = this
|
||||
if(!value){
|
||||
that.$message.error("请填写路径")
|
||||
return false
|
||||
}
|
||||
this.resultJson = {};
|
||||
axios({
|
||||
url: value,
|
||||
method: this.requestMethod,
|
||||
data: this.paramJson
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
this.resultJson = res
|
||||
}).catch((err) => {
|
||||
that.$message.error("请求异常:"+err)
|
||||
})
|
||||
},
|
||||
changeVal(e){
|
||||
try {
|
||||
let json = e.target.value;
|
||||
if(json.indexOf(",}")>0){
|
||||
json = json.replace(",}","}");
|
||||
}
|
||||
this.paramJson = JSON.parse(json);
|
||||
}catch (e) {
|
||||
console.log(e);
|
||||
this.$message.error("非法的JSON字符串")
|
||||
}
|
||||
},
|
||||
handleChange(value) {
|
||||
this.requestMethod = value;
|
||||
},
|
||||
created () {
|
||||
const token = Vue.ls.get(ACCESS_TOKEN);
|
||||
this.headers = {"X-Access-Token":token}
|
||||
|
||||
}
|
||||
handleChange (value) {
|
||||
this.requestMethod = value
|
||||
},
|
||||
created () {
|
||||
const token = Vue.ls.get(ACCESS_TOKEN)
|
||||
this.headers = { 'X-Access-Token': token }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user