当前位置: 首页 > news >正文

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

背景需求

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;}
}

相关文章:

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

背景需求 ruoyi框架,前后端分离。现在要在用户访问的时候根据不同的设备跳转到不同的登录页面。 教程 router/index.js 修改src/router/index.js,在这里增加自己的要跳转的页面 permission.js 在白名单中添加自己的登录页面 增加以下识别的代码 le…...

OpenGL —— 2.8、漫游之摄像机飞行移动(附源码,glfw+glad)

源码效果 C源码 纹理图片 需下载stb_image.h这个解码图片的库,该库只有一个头文件。 具体代码: vertexShader.glsl #version 330 corelayout(location 0) in vec3 aPos; layout(location 1) in vec2 aUV;out vec2 outUV;uniform mat4 _modelMatrix; …...

AM@麦克劳林公式逼近以及误差分析

abstract 麦克劳林公式及其近似表示的应用误差估计和分析 Lagrange型泰勒公式的估计误差 由Lagrange型余项泰勒公式可知,多项式 p n ( x ) p_n(x) pn​(x)近似表达函数 f ( x ) f(x) f(x)时,其误差为 ∣ R n ( x ) ∣ |R_{n}(x)| ∣Rn​(x)∣ R n ( x ) R_{n}(x) Rn​(x) f …...

gitlab 离线安装问题解决:NOKEY,signature check fail

1,rpm安装gitlab问题 test1:/opt # rpm -ivh gitlab-ce-16.0.3-ce.0.el7.x86_64.rpm --force warning: gitlab-ce-16.0.3-ce.0.el7.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID f27eab47: NOKEY error: [upel]: gitlab-ce NOKEY error: [upel]: gitlab-ce …...

uniapp使用uQRCode绘制二维码,下载到本地,调起微信扫一扫二维码核销

1.效果 2.在utils文件夹下创建uqrcode.js // uqrcode.js //--------------------------------------------------------------------- // github https://github.com/Sansnn/uQRCode //---------------------------------------------------------------------let uQRCode {…...

手写一个PrattParser基本运算解析器3: 基于Swift的PrattParser的项目概述

点击查看 基于Swift的PrattParser项目 PrattParser项目概述 前段时间一直想着手恶补 编译原理 的相关知识, 一开始打算直接读大学的 编译原理, 虽然内容丰富, 但是着实抽象难懂. 无意间看到B站的熊爷关于普拉特解析器相关内容, 感觉是一个非常好的切入点.所以就写了基于Swift版…...

三江学院“火焰杯”软件测试高校就业选拔赛颁奖仪式

11月25日下午,“火焰杯”软件测试开发选拔赛及三江-慧科卓越工程师班暑期编程能力训练营颁奖仪式在s楼会议室隆重举行。计算机科学与工程学院院长刘亚军、副院长叶传标、曹阳、吴德、院党总支副书记王兰英、系主任杨少雄、慧科企业代表尹沁伊人、项目负责人王旭出席…...

面试题-消息中间件篇-主流的消息中间件

消息中间件篇 第一章 主流的消息中间件对比 1、主流的消息中间件有 Kafka、RabbitMQ、ActiveMQ 等。 Kafka: Kafka 是一种高吞吐量、分布式、可扩展的发布/订阅消息系统,主要用于大数据处理和分析。Kafka 采用消息日志的方式来存储消息,可以…...

PyQt学习笔记-获取Hash值的小工具

目录 一、概述1.1 版本信息:1.2 基本信息:1.2.1 软件支持的内容:1.2.2 支持的编码格式 1.3 软件界面图 二、代码实现2.1 View2.2 Controller2.3 Model 三、测试示例 一、概述 本工具居于hashlibPyQtQFileDialog写的小工具,主要是…...

【(数据结构)— 双向链表的实现】

(数据结构)— 双向链表的实现 一.双向链表的结构二. 双向链表的实现2.1 头文件 ——双向链表的创建及功能函数的定义2.2 源文件 ——双向链表的功能函数的实现2.3 源文件 ——双向链表功能的测试2.4 双向链表各项功能测试运行展示2.4.1 双向链表的初始化…...

酷克数据发布HD-SQL-LLaMA模型,开启数据分析“人人可及”新时代

随着行业数字化进入深水区,企业的关注点正在不断从“数字”价值转向“数智”价值。然而,传统数据分析的操作门槛与时间成本成为了掣肘数据价值释放的阻力。常规的数据分析流程复杂冗长,需要数据库管理员设计数据模型,数据工程师进…...

FL Studio21最新中文破解进阶高级完整版安装下载教程

目前水果软件最版本是FL Studio21,它让你的计算机就像是全功能的录音室,大混音盘,非常先进的制作工具,让你的音乐突破想象力的限制。喜欢音乐制作的小伙伴千万不要错过这个功能强大,安装便捷的音乐软件哦!如…...

MDN--Web性能

CSS 动画与 JavaScript 动画 动画的实现可以有很多种方式,比如 CSS transition 和 animation 或者基于 JavaScript 的动画(使用 requestAnimationFrame()) CSS 过渡和动画 CSS transiton :创建当前样式与结束状态样式之间的动画。尽管一个元素处于过渡状态中&…...

Vue3.js:自定义组件 v-model

Vue3的自定义v-model和vue2稍有不同 文档 https://cn.vuejs.org/guide/components/v-model.html 目录 原生组件自定义组件CustomInput实现代码1CustomInput实现代码2 v-model 的参数 原生组件 <input v-model"searchText" />等价于 <input:value"s…...

AI虚拟主播开发实战(附源码)

人工智能 文章目录 人工智能前言 前言 https://blog.csdn.net/icemanyandy/article/details/124035967...

innoDB如何解决幻读

Mysql的事务隔离级别 Mysql 有四种事务隔离级别&#xff0c;这四种隔离级别代表当存在多个事务并发冲突时&#xff0c;可能出现的脏读、不可重复读、幻读的问题。其中 InnoDB 在 RR 的隔离级别下&#xff0c;解决了幻读的问题 事务隔离级别脏读不可重复读幻读未提交读&#xff…...

Git - 导出(archive)、忽略(gitignore)、隐藏(Stash)、合并冲突(merge)的解决方法

概述 本次集中总结了Git4个常规操作&#xff0c;导出(archive)、忽略(gitignore)、隐藏(Stash)、合并冲突(merge)的解决方法&#xff0c;希望帮助到正在辛苦寻找的你。 .gitignore忽略文件 之前开发和部署服务比较仓促&#xff0c;所以有很多图片文件一起加载到服务中&#…...

【Javascript】‘var‘ is used instead of ‘let‘ or ‘const‘

解决&#xff1a; 设置完之后,var 就不会再出现黄色波浪线警告...

金融统计学方法:神经网络

目录 1.神经网络 2.深度神经网络 3.案例分析 1.神经网络 神经网络是模仿人脑神经元工作原理而设计的一种算法模型。在一个基本的神经网络中&#xff0c;存在多个“神经元”或称为“节点”&#xff0c;这些节点被组织成多个层次。每个节点都接收前一层的输入&#xff0c;进行…...

任何人不知道这款超实用的配音软件,我都会伤心的OK?

看完一段精彩的视频&#xff0c;令人陶醉的原因之一就是配音&#xff0c;有的充满感情&#xff0c;有的字正腔圆&#xff0c;相信很多人都不知道这样的声音是怎么配出来的&#xff1f;今天&#xff0c;小编就来给大家分享一款超实用的配音软件&#xff0c;不仅操作简单&#xf…...

浏览器访问 AWS ECS 上部署的 Docker 容器(监听 80 端口)

✅ 一、ECS 服务配置 Dockerfile 确保监听 80 端口 EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]或 EXPOSE 80 CMD ["python3", "-m", "http.server", "80"]任务定义&#xff08;Task Definition&…...

龙虎榜——20250610

上证指数放量收阴线&#xff0c;个股多数下跌&#xff0c;盘中受消息影响大幅波动。 深证指数放量收阴线形成顶分型&#xff0c;指数短线有调整的需求&#xff0c;大概需要一两天。 2025年6月10日龙虎榜行业方向分析 1. 金融科技 代表标的&#xff1a;御银股份、雄帝科技 驱动…...

eNSP-Cloud(实现本地电脑与eNSP内设备之间通信)

说明&#xff1a; 想象一下&#xff0c;你正在用eNSP搭建一个虚拟的网络世界&#xff0c;里面有虚拟的路由器、交换机、电脑&#xff08;PC&#xff09;等等。这些设备都在你的电脑里面“运行”&#xff0c;它们之间可以互相通信&#xff0c;就像一个封闭的小王国。 但是&#…...

mongodb源码分析session执行handleRequest命令find过程

mongo/transport/service_state_machine.cpp已经分析startSession创建ASIOSession过程&#xff0c;并且验证connection是否超过限制ASIOSession和connection是循环接受客户端命令&#xff0c;把数据流转换成Message&#xff0c;状态转变流程是&#xff1a;State::Created 》 St…...

质量体系的重要

质量体系是为确保产品、服务或过程质量满足规定要求&#xff0c;由相互关联的要素构成的有机整体。其核心内容可归纳为以下五个方面&#xff1a; &#x1f3db;️ 一、组织架构与职责 质量体系明确组织内各部门、岗位的职责与权限&#xff0c;形成层级清晰的管理网络&#xf…...

网络编程(UDP编程)

思维导图 UDP基础编程&#xff08;单播&#xff09; 1.流程图 服务器&#xff1a;短信的接收方 创建套接字 (socket)-----------------------------------------》有手机指定网络信息-----------------------------------------------》有号码绑定套接字 (bind)--------------…...

使用Matplotlib创建炫酷的3D散点图:数据可视化的新维度

文章目录 基础实现代码代码解析进阶技巧1. 自定义点的大小和颜色2. 添加图例和样式美化3. 真实数据应用示例实用技巧与注意事项完整示例(带样式)应用场景在数据科学和可视化领域,三维图形能为我们提供更丰富的数据洞察。本文将手把手教你如何使用Python的Matplotlib库创建引…...

Pydantic + Function Calling的结合

1、Pydantic Pydantic 是一个 Python 库&#xff0c;用于数据验证和设置管理&#xff0c;通过 Python 类型注解强制执行数据类型。它广泛用于 API 开发&#xff08;如 FastAPI&#xff09;、配置管理和数据解析&#xff0c;核心功能包括&#xff1a; 数据验证&#xff1a;通过…...

webpack面试题

面试题&#xff1a;webpack介绍和简单使用 一、webpack&#xff08;模块化打包工具&#xff09;1. webpack是把项目当作一个整体&#xff0c;通过给定的一个主文件&#xff0c;webpack将从这个主文件开始找到你项目当中的所有依赖文件&#xff0c;使用loaders来处理它们&#x…...

Android屏幕刷新率与FPS(Frames Per Second) 120hz

Android屏幕刷新率与FPS(Frames Per Second) 120hz 屏幕刷新率是屏幕每秒钟刷新显示内容的次数&#xff0c;单位是赫兹&#xff08;Hz&#xff09;。 60Hz 屏幕&#xff1a;每秒刷新 60 次&#xff0c;每次刷新间隔约 16.67ms 90Hz 屏幕&#xff1a;每秒刷新 90 次&#xff0c;…...