跨境派

跨境派

跨境派,专注跨境行业新闻资讯、跨境电商知识分享!

当前位置:首页 > 卖家故事 > VUE前端判断是电脑端还是移动端

VUE前端判断是电脑端还是移动端

时间:2024-04-28 15:50:13 来源:网络cs 作者:胡椒 栏目:卖家故事 阅读:

标签: 电脑  移动  判断 
阅读本书更多章节>>>>

背景需求

ruoyi框架,前后端分离。现在要在用户访问的时候根据不同的设备跳转到不同的登录页面。

教程

router/index.js

修改src/router/index.js,在这里增加自己的要跳转的页面

permission.js

在白名单中添加自己的登录页面

增加以下识别的代码

let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)      if (flag) {        console.log('手机端');        next(`/loginPhone?redirect=${to.fullPath}`)      } else {        console.log('pc端');        next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页      }      NProgress.done()

结束

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

package cn.renkai721.bean.vo; import lombok.extern.slf4j.Slf4j; @Slf4jpublic class MakeUpTheWordCount {     private String make_up_the_word_count_column_999999999_1;    private String make_up_the_word_count_column_999999999_2;    private String make_up_the_word_count_column_999999999_3;    private String make_up_the_word_count_column_999999999_4;    private String make_up_the_word_count_column_999999999_5;    private String make_up_the_word_count_column_999999999_6;    private String make_up_the_word_count_column_999999999_7;    private String make_up_the_word_count_column_999999999_8;    private String make_up_the_word_count_column_999999999_9;    private String make_up_the_word_count_column_999999999_10;    private String make_up_the_word_count_column_999999999_11;    private String make_up_the_word_count_column_999999999_12;    private String make_up_the_word_count_column_999999999_13;    private String make_up_the_word_count_column_999999999_14;    private String make_up_the_word_count_column_999999999_15;    private String make_up_the_word_count_column_999999999_16;    private String make_up_the_word_count_column_999999999_17;    private String make_up_the_word_count_column_999999999_18;    private String make_up_the_word_count_column_999999999_19;    private String make_up_the_word_count_column_999999999_20;     public String getMake_up_the_word_count_column_999999999_1() {        return make_up_the_word_count_column_999999999_1;    }     public void setMake_up_the_word_count_column_999999999_1(String make_up_the_word_count_column_999999999_1) {        this.make_up_the_word_count_column_999999999_1 = make_up_the_word_count_column_999999999_1;    }     public String getMake_up_the_word_count_column_999999999_2() {        return make_up_the_word_count_column_999999999_2;    }     public void setMake_up_the_word_count_column_999999999_2(String make_up_the_word_count_column_999999999_2) {        this.make_up_the_word_count_column_999999999_2 = make_up_the_word_count_column_999999999_2;    }     public String getMake_up_the_word_count_column_999999999_3() {        return make_up_the_word_count_column_999999999_3;    }     public void setMake_up_the_word_count_column_999999999_3(String make_up_the_word_count_column_999999999_3) {        this.make_up_the_word_count_column_999999999_3 = make_up_the_word_count_column_999999999_3;    }     public String getMake_up_the_word_count_column_999999999_4() {        return make_up_the_word_count_column_999999999_4;    }     public void setMake_up_the_word_count_column_999999999_4(String make_up_the_word_count_column_999999999_4) {        this.make_up_the_word_count_column_999999999_4 = make_up_the_word_count_column_999999999_4;    }     public String getMake_up_the_word_count_column_999999999_5() {        return make_up_the_word_count_column_999999999_5;    }     public void setMake_up_the_word_count_column_999999999_5(String make_up_the_word_count_column_999999999_5) {        this.make_up_the_word_count_column_999999999_5 = make_up_the_word_count_column_999999999_5;    }     public String getMake_up_the_word_count_column_999999999_6() {        return make_up_the_word_count_column_999999999_6;    }     public void setMake_up_the_word_count_column_999999999_6(String make_up_the_word_count_column_999999999_6) {        this.make_up_the_word_count_column_999999999_6 = make_up_the_word_count_column_999999999_6;    }     public String getMake_up_the_word_count_column_999999999_7() {        return make_up_the_word_count_column_999999999_7;    }     public void setMake_up_the_word_count_column_999999999_7(String make_up_the_word_count_column_999999999_7) {        this.make_up_the_word_count_column_999999999_7 = make_up_the_word_count_column_999999999_7;    }     public String getMake_up_the_word_count_column_999999999_8() {        return make_up_the_word_count_column_999999999_8;    }     public void setMake_up_the_word_count_column_999999999_8(String make_up_the_word_count_column_999999999_8) {        this.make_up_the_word_count_column_999999999_8 = make_up_the_word_count_column_999999999_8;    }     public String getMake_up_the_word_count_column_999999999_9() {        return make_up_the_word_count_column_999999999_9;    }     public void setMake_up_the_word_count_column_999999999_9(String make_up_the_word_count_column_999999999_9) {        this.make_up_the_word_count_column_999999999_9 = make_up_the_word_count_column_999999999_9;    }     public String getMake_up_the_word_count_column_999999999_10() {        return make_up_the_word_count_column_999999999_10;    }     public void setMake_up_the_word_count_column_999999999_10(String make_up_the_word_count_column_999999999_10) {        this.make_up_the_word_count_column_999999999_10 = make_up_the_word_count_column_999999999_10;    }     public String getMake_up_the_word_count_column_999999999_11() {        return make_up_the_word_count_column_999999999_11;    }     public void setMake_up_the_word_count_column_999999999_11(String make_up_the_word_count_column_999999999_11) {        this.make_up_the_word_count_column_999999999_11 = make_up_the_word_count_column_999999999_11;    }     public String getMake_up_the_word_count_column_999999999_12() {        return make_up_the_word_count_column_999999999_12;    }     public void setMake_up_the_word_count_column_999999999_12(String make_up_the_word_count_column_999999999_12) {        this.make_up_the_word_count_column_999999999_12 = make_up_the_word_count_column_999999999_12;    }     public String getMake_up_the_word_count_column_999999999_13() {        return make_up_the_word_count_column_999999999_13;    }     public void setMake_up_the_word_count_column_999999999_13(String make_up_the_word_count_column_999999999_13) {        this.make_up_the_word_count_column_999999999_13 = make_up_the_word_count_column_999999999_13;    }     public String getMake_up_the_word_count_column_999999999_14() {        return make_up_the_word_count_column_999999999_14;    }     public void setMake_up_the_word_count_column_999999999_14(String make_up_the_word_count_column_999999999_14) {        this.make_up_the_word_count_column_999999999_14 = make_up_the_word_count_column_999999999_14;    }     public String getMake_up_the_word_count_column_999999999_15() {        return make_up_the_word_count_column_999999999_15;    }     public void setMake_up_the_word_count_column_999999999_15(String make_up_the_word_count_column_999999999_15) {        this.make_up_the_word_count_column_999999999_15 = make_up_the_word_count_column_999999999_15;    }     public String getMake_up_the_word_count_column_999999999_16() {        return make_up_the_word_count_column_999999999_16;    }     public void setMake_up_the_word_count_column_999999999_16(String make_up_the_word_count_column_999999999_16) {        this.make_up_the_word_count_column_999999999_16 = make_up_the_word_count_column_999999999_16;    }     public String getMake_up_the_word_count_column_999999999_17() {        return make_up_the_word_count_column_999999999_17;    }     public void setMake_up_the_word_count_column_999999999_17(String make_up_the_word_count_column_999999999_17) {        this.make_up_the_word_count_column_999999999_17 = make_up_the_word_count_column_999999999_17;    }     public String getMake_up_the_word_count_column_999999999_18() {        return make_up_the_word_count_column_999999999_18;    }     public void setMake_up_the_word_count_column_999999999_18(String make_up_the_word_count_column_999999999_18) {        this.make_up_the_word_count_column_999999999_18 = make_up_the_word_count_column_999999999_18;    }     public String getMake_up_the_word_count_column_999999999_19() {        return make_up_the_word_count_column_999999999_19;    }     public void setMake_up_the_word_count_column_999999999_19(String make_up_the_word_count_column_999999999_19) {        this.make_up_the_word_count_column_999999999_19 = make_up_the_word_count_column_999999999_19;    }     public String getMake_up_the_word_count_column_999999999_20() {        return make_up_the_word_count_column_999999999_20;    }     public void setMake_up_the_word_count_column_999999999_20(String make_up_the_word_count_column_999999999_20) {        this.make_up_the_word_count_column_999999999_20 = make_up_the_word_count_column_999999999_20;    }}

阅读本书更多章节>>>>

本文链接:https://www.kjpai.cn/gushi/2024-04-28/163275.html,文章来源:网络cs,作者:胡椒,版权归作者所有,如需转载请注明来源和作者,否则将追究法律责任!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。

文章评论