Skip to content

Commit

Permalink
修复IP查询问题
Browse files Browse the repository at this point in the history
- 修复查询问题
  • Loading branch information
Mintimate committed Apr 21, 2023
1 parent 5d1535c commit 4c300d8
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 53 deletions.
39 changes: 22 additions & 17 deletions OnlineToolFrontEndVite/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,27 @@
</router-link>
<a-menu-item key="1_1">Github加速</a-menu-item>
</a-sub-menu>
<router-link to="/processIMG">
<a-menu-item key="2">
<template #icon>
<icon-file-image/>
</template>
图片在线处理
</a-menu-item>
</router-link>
<a-sub-menu key="3">
<template #icon>
<icon-bulb/>
</template>
<template #title>字符/计算工具</template>
<router-link to="/textBase64">
<a-menu-item key="3_1">
Base64编码互转
</a-menu-item>
<router-link to="/randomNumber">
<a-menu-item key="3_1">范围随机数排列</a-menu-item>
</router-link>
<router-link to="/statisticsChars">
<a-menu-item key="3_2">统计字数/字符</a-menu-item>
<a-menu-item key="3_2">统计字数/字符</a-menu-item>
</router-link>
<router-link to="/textBase64">
<a-menu-item key="3_3">Base64编码互转</a-menu-item>
</router-link>
</a-sub-menu>
<a-menu-item key="4">
Expand All @@ -53,12 +56,14 @@
</template>
Markdown渲染
</a-menu-item>
<a-menu-item key="6">
<template #icon>
<icon-public/>
</template>
个人博客
</a-menu-item>
<a href="https://www.mintimate.cn" target="_blank">
<a-menu-item key="6">
<template #icon>
<icon-public/>
</template>
个人博客
</a-menu-item>
</a>
</a-menu>
</div>
<div class="layout-header-menu-wrapper-right">
Expand Down Expand Up @@ -89,24 +94,24 @@

<style scoped>
/** 图标设置 */
/deep/ .arco-menu-icon {
:deep(.arco-menu-icon){
margin-right: 5px !important;
}
/deep/ .arco-menu-has-icon {
:deep(.arco-menu-has-icon){
margin-left: 5px !important;
}
/deep/ .arco-menu-horizontal .arco-menu-item {
:deep(.arco-menu-horizontal .arco-menu-item){
padding: 0 8px;
}
/deep/ .arco-menu-horizontal {
:deep(.arco-menu-horizontal) {
margin-left: 5px;
}
a{
text-decoration:none;
a {
text-decoration: none;
}
.layout-header {
Expand Down
12 changes: 11 additions & 1 deletion OnlineToolFrontEndVite/src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ const routes = [
{
path: '/',
name: 'ip',
component: () => import('@/views/ip.vue')
component: () => import('@/views/ip.vue'),
},
{
path: '/processIMG',
name: 'processImage',
component: () => import('@/views/processImage.vue'),
},
{
path: '/textBase64',
Expand All @@ -16,6 +21,11 @@ const routes = [
name: 'statisticsChars',
component: () => import('@/views/characterTool/statisticAlpha.vue')
},
{
path: '/randomNumber',
name: 'randomNumber',
component: () => import('@/views/characterTool/randomNumber.vue')
},
]

const router = createRouter({
Expand Down
67 changes: 32 additions & 35 deletions OnlineToolFrontEndVite/src/views/ip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,45 +53,42 @@
</div>
</div>
</template>

<script>
<script setup>
import {useHead} from '@unhead/vue'
import {onMounted, reactive, ref} from "vue";
import {get} from "@/until/request.js"
export default {
name: "ip.vue",
setup() {
let userIP = ref("...加载中...");
let userIP_Info =reactive({
display: false,
area: "",
remark:""
})
onMounted(() => {
handleImgSrc();
})
let NotFoundIMG = ref("");
let curlGetIPDemo = ref("");
const handleImgSrc = async () => {
let m = await import("@/assets/IP_Utils/404.png");
let c = await import("@/assets/IP_Utils/curlGetIPDemo.png")
NotFoundIMG.value = m.default;
curlGetIPDemo.value = c.default;
};
get("/IP/getIP").then(resp => {
userIP.value = resp
})
function getIP_Info(ip){
get("/IP/getInfo/"+ip.toString()).then(resp=>{
userIP_Info.display = true;
console.log(resp.data)
userIP_Info.area = resp.data.mainInfo;
userIP_Info.remark = resp.data.appendInfo;
})
}
useHead({
title: 'My awesome site'
})
let userIP = ref("...加载中...");
let userIP_Info = reactive({
display: false,
area: "",
remark: ""
})
onMounted(() => {
handleImgSrc();
})
let NotFoundIMG = ref("");
let curlGetIPDemo = ref("");
const handleImgSrc = async () => {
let m = await import("@/assets/IP_Utils/404.png");
let c = await import("@/assets/IP_Utils/curlGetIPDemo.png")
NotFoundIMG.value = m.default;
curlGetIPDemo.value = c.default;
};
get("/IP/getIP").then(resp => {
userIP.value = resp
})
return {userIP,userIP_Info, NotFoundIMG, curlGetIPDemo,getIP_Info}
}
function getIP_Info(ip) {
get("/IP/getInfo/" + ip.toString()).then(resp => {
userIP_Info.display = true;
console.log(resp.data)
userIP_Info.area = resp.data.mainInfo;
userIP_Info.remark = resp.data.appendInfo;
})
}
</script>

Expand Down

0 comments on commit 4c300d8

Please sign in to comment.