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

news2025/1/19 17:13:48

背景需求

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;
 
@Slf4j
public 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;
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1107224.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

solidworks 2024新功能之-打造更加智能的工作 硕迪科技

SOLIDWORKS 2024 的新增功能 SOLIDWORKS 的每个版本都致力于改进您的工作流程,使您常用的工具尽可能快速高效地运作。此外,SOLIDWORKS 2024 可以通过量身定制的解决方案扩展您的工具集,并使您能够通过 Cloud Services 轻松将您的设计数据连接…

vue 写一个大富翁 和 老虎机组件

大富翁 老虎机https://github.com/YaminZheng/zillionaire.git Vue Ts 编写的大富翁,支持自定义路径,动画和图片可以自行添加 Dev git clone https://github.com/YaminZheng/zillionaire.git cd zillionaire yarn set version stable yarn install …

文心大模型4.0亮相2023百度世界大会,助力各赛道应用进一步发展

🏆作者简介,黑夜开发者,CSDN领军人物,全栈领域优质创作者✌,CSDN博客专家,阿里云社区专家博主,2023年6月CSDN上海赛道top4。 🏆数年电商行业从业经验,历任核心研发工程师…

Map<String, Object> 和 com.fasterxml.jackson.databind.node.ObjectNode区别

Map<String, Object>和com.fasterxml.jackson.databind.node.ObjectNode都可以用来表示一个键值对集合&#xff0c;其中键是字符串&#xff0c;值可以是任何对象。 Map<String, Object>是Java标准库中的一种数据结构&#xff0c;用于存储一组键值对。它是一个接口…

【Electron】Not allowed to load local resource

问题描述 使用 audio 标签播放音频文件&#xff0c;控制台报错 Not allowed to load local resource。 Not allowed to load local resource原因分析 通常是安全策略所引起的。Electron 默认情况下禁止加载本地资源&#xff0c;以防止潜在的安全风险。 解决方案 在 main.js…

1208. 翻硬币

题目&#xff1a; 1208. 翻硬币 - AcWing题库 思路&#xff1a; 1.对于要求从A变化到B的这类题&#xff0c;可以采用开关控制的方法。 2.一次翻转连续两个硬币&#xff0c;求origin变为result 最少需要翻转多少次。我们在origin的两个硬币中间放一个开关&#xff0c;开关变换…

代码随想录第四十三天|343. 整数拆分 ● 96.不同的二叉搜索树

343.整数拆分 题目&#xff1a; 给定一个正整数 n&#xff0c;将其拆分为至少两个正整数的和&#xff0c;并使这些整数的乘积最大化。 返回你可以获得的最大乘积。 示例 1: 输入: 2 输出: 1 解释: 2 1 1, 1 1 1。 示例 2: 输入: 10 输出: 36 解释: 10 3 3 4, 3 3 4 …

Linux:命令行参数和环境变量

文章目录 命令行参数环境变量环境变量的概念常见的环境变量PATH 环境变量表本地变量和环境变量命令分类 本篇主要解决以下问题&#xff1a; 什么是命令行参数命令行参数有什么用环境变量是什么环境变量存在的意义 命令行参数 在学习C语言中&#xff0c;对于main函数当初的写…

Spring framework Day 23:容器事件

前言 容器事件是 Spring Framework 中的一个重要概念&#xff0c;它提供了一种机制&#xff0c;使我们能够更好地了解和响应 Spring 容器中发生的各种事件。通过容器事件&#xff0c;我们可以在特定的时间点监听和处理容器中的各种状态变化、操作和事件触发&#xff0c;以实现…

【网络编程】多路转接之select、poll、epoll

目录 一、如何进行高效的IO 以read/recv为例 二、五种IO模型 三、常见的高级IO 四、非阻塞IO 1、recv和send自带的非阻塞IO 2、可以将文件描述符设为非阻塞 2.1open自带的非阻塞IO 2.2通过fcntl函数将一个文件描述符设置为非阻塞 2.3非阻塞IO的返回值判定 三、多路转…

网络安全(黑客)自学方向

每年报考网络安全专业的人数很多&#xff0c;但不少同学听说千万别学网络安全&#xff0c;害怕网络安全专业很难就业。下面就带大家深入了解一下网络安全专业毕业后可以干什么&#xff0c;包括网络安全专业的就业前景和方向等。 随着信息化时代的到来&#xff0c;网络安全行业…

Intellij IDEA 运行时报 Command line is too long

文章目录 前言解决方法2020.3 之前的版本2020.3 以及之后版本 前言 有时候使用Intellij IDE 使用项目时&#xff0c;会出现“Command line is too long” 错误&#xff0c;查了很多资料才找到解决方案。为解决该错误颇费周折&#xff0c;写下此文让同道中人少走弯路。 解决方法…

ROL,PIT,YAW

简言之&#xff0c; roll是旋转角&#xff0c;是“翻滚”。绕X轴旋转,ROL pitch是俯仰角&#xff0c;是“点头“。绕Y轴旋转,PIT yaw是偏航角&#xff0c;是‘摇头“。绕Z轴旋转,YAW

软考考试时间已出!采用连考形式!

2023年下半年计算机技术与软件专业技术资格&#xff08;水平&#xff09;考试批次安排已出&#xff01;下面是具体的考试安排。 通知原文如下&#xff1a;↓↓↓ 按照《2023年下半年计算机技术与软件专业技术资格&#xff08;水平&#xff09;考试有关工作调整的通告》&#x…

代码随想录算法训练营第二十六天 | LeetCode 39. 组合总和、40. 组合总和 II、131. 分割回文串

代码随想录算法训练营第二十六天 | LeetCode 39. 组合总和、40. 组合总和 II、131. 分割回文串 文章链接&#xff1a;组合总和 组合总和II 分割回文串 视频链接&#xff1a;组合总和 组合总和II 分割回文串 目录 代码随想录算法训练营第二十六天 …

leetcode 5

leetcode 5 题目是通过枚举字符串&#xff0c;然后判断是否子字符串满足回文。 引用传递和值传递相比&#xff0c;引用传递可以减少内存空间。提高代码运行效率。 https://www.cnblogs.com/yanlingyin/archive/2011/12/07/2278961.html

ZKP4.1 SNARKs via Interactive Proofs (Justin Thaler)

ZKP学习笔记 ZK-Learning MOOC课程笔记 Lecture 4: SNARKs via Interactive Proofs (Justin Thaler) 4.1 Interactive Proofs: Motivation and Model Interactive Proofs P solves problem, tells V the answer. Then they have a conversation.P’s goal: convince V the …

微信小程序一键获取位置

需求 有个表单需要一键获取对应位置 并显示出来效果如下&#xff1a; 点击一键获取获取对应位置 显示在 picker 默认选中 前端 代码如下: <view class"box_7 {{ showChange1? change-style: }}"><view class"box_11"><view class"…

Excel·VBA单元格区域数据对比差异标记颜色

之前的一篇博客《ExcelVBA单元格重复值标记颜色》&#xff0c;是对重复的整行标记颜色 而本文是按行对比2个单元格区域的数据&#xff0c;并对有差异的区域&#xff08;一个单元格区域有的&#xff0c;而另一个单元格区域没有的&#xff09;标记颜色&#xff0c;且只要存在任意…

杨辉三角按列求和

假设求杨辉三角这一列 我们考虑这个格子&#xff1a; 然后对其不断展开 综上&#xff1a; ∑ i 0 n ( i k ) ( n 1 k 1 ) \sum_{i0}^n\binom i k\binom {n1}{k1} i0∑n​(ki​)(k1n1​) ∑ i l r ( i k ) ( r 1 k 1 ) − ( l k 1 ) \sum_{il}^r\binom i k\binom{r1}{k…