0


(vue)前端获取ip方法

(vue)前端获取ip方法


data(){return:{
        ipAddress:"",}},mounted(){
   this.getIPAddress();},//获取ipgetIPAddress(){const url ="http://api.ipify.org?format=json";
  this.axios.get(url).then((response)=>{
    this.ipAddress = response.data.ip;
    console.log(this.ipAddress);});},

解决参考:https://www.fke6.com/html/78898.html


本文转载自: https://blog.csdn.net/qq_44754635/article/details/130969896
版权归原作者 nyf_unknown 所有, 如有侵权,请联系我们删除。

“(vue)前端获取ip方法”的评论:

还没有评论