提交 49307d37 编写于 作者: M m0_60155232

Wed Sep 13 12:04:00 CST 2023 inscode

上级 87ffa0b0
<template> <template>
<button @click="parseHanle">解析</button> <div id="container">
<!-- 描述 -->
<Desc ref="Desc_text"></Desc>
<!-- 原始框 -->
<textarea name="" id="" cols="160" rows="10" placeholder="域名" v-model="before_str"></textarea>
<!-- 转换按钮 -->
<div id="my_btn">
<button @click="parseHanle">解析</button>
</div>
<!-- 转换结果 -->
<textarea name="" id="" cols="160" rows="10" placeholder="解析的结果" v-model="after_str"></textarea>
</div>
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from "vue";
import { ElMessage } from 'element-plus'
import Desc from "../components/Desc.vue"
import axios from 'axios'; import axios from 'axios';
// 域名解析处理器
let Desc_text = ref(null);
onMounted(() => {
Desc_text.value.setDescText(`DNS域名解析服务,可用于测试域名是否解析成功。`)
})
// 原始串
let before_str = ref("")
// 解析串
let after_str = ref("")
// 解析处理器
async function parseHanle() { async function parseHanle() {
const res = await axios.get("http://139.159.151.0:8080/parse?domain=meibu1g.cn"); // 判断空
console.log(res); if (before_str.value == "") {
} ElMessage("请输入域名后解析")
return 0;
}
const res = await axios.get(`https://139.159.151.0/parse?domain=${before_str.value}`);
after_str.value = res.data;
}
</script> </script>
<style scoped></style> <style scoped>
\ No newline at end of file .text_box {
border: solid rgb(114 113 113) 1px;
height: 200px;
border-radius: 5px;
}
#my_btn {
display: flex;
justify-content: center;
padding: 20px 0px;
}
textarea {
padding: 10px;
}
#my_btn button {
width: 90px;
height: 35px;
border: none;
background: linear-gradient(to right, #eae0e0, #dda5a5);
cursor: pointer;
}
#my_btn button:hover {
background: linear-gradient(to right, #eae0e0, #df6262);
}
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册