若依 Ruoyi-Vue获取用户登录信息

前端

bash 复制代码
// 获取用户名和用户ID
const userid = this.$store.state.user.id;
const username = this.$store.state.user.name;
//部门名
this.$store.state.user.userInfo.dept.deptId

后端

bash 复制代码
SecurityUtils.getUserId();
SecurityUtils.getDeptId();
SecurityUtils.getLoginUser().getUser().getDept().getDeptName();
相关推荐
雨季6661 天前
构建 OpenHarmony 简易文字行数统计器:用字符串分割实现纯文本结构感知
开发语言·前端·javascript·flutter·ui·dart
雨季6661 天前
Flutter 三端应用实战:OpenHarmony 简易倒序文本查看器开发指南
开发语言·javascript·flutter·ui
小北方城市网1 天前
Redis 分布式锁高可用实现:从原理到生产级落地
java·前端·javascript·spring boot·redis·分布式·wpf
console.log('npc')1 天前
vue2 使用高德接口查询天气
前端·vue.js
2401_892000521 天前
Flutter for OpenHarmony 猫咪管家App实战 - 添加支出实现
前端·javascript·flutter
天马37981 天前
Canvas 倾斜矩形绘制波浪效果
开发语言·前端·javascript
天天向上10241 天前
vue3 实现el-table 部分行不让勾选
前端·javascript·vue.js
qx091 天前
esm模块与commonjs模块相互调用的方法
开发语言·前端·javascript
摘星编程1 天前
在OpenHarmony上用React Native:SectionList吸顶分组标题
javascript·react native·react.js
Mr Xu_1 天前
前端实战:基于Element Plus的CustomTable表格组件封装与应用
前端·javascript·vue.js·elementui