# temp-project **Repository Path**: tukela/temp-project ## Basic Information - **Project Name**: temp-project - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-24 - **Last Updated**: 2026-07-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 浏览器获取公网IP ```js const getLocalIP =()=> { return new Promise((resolve, reject) => { const pc = new RTCPeerConnection({ iceServers: [{ urls: "stun:stun.l.google.com:19302" }] }); pc.createDataChannel(""); pc.createOffer() .then(offer => pc.setLocalDescription(offer)) .catch(reject); pc.onicecandidate = event => { console.log(event) if (event && event.candidate && event.candidate.candidate) { const ipMatch = event.candidate.candidate.match( /([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/ ); if (ipMatch) { resolve(ipMatch[1]); pc.close(); } } }; }); } ``` 使用 `Vue3 + Vite + Pinia + NaiveUi` 遵从约定大于规范, 页面路由根据pages目录层级结构生成无需手动添加 UI组件库[NaiveUi](https://www.naiveui.com/zh-CN/dark/components/button) `https://www.naiveui.com/zh-CN/dark/components/button` 支持中英文切换 接口使用方法 ```js