若依 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();
相关推荐
LaughingZhu2 分钟前
Product Hunt 每日热榜 | 2026-07-17
前端·数据库·人工智能·经验分享·mysql·chatgpt·html
潇凝子潇7 分钟前
UnsupportedOperationException
java·前端·数据库
卷无止境8 分钟前
Python 跨平台 GUI 解决方案全景报告
前端·python
万少7 小时前
用腻了 WorkBuddy 的默认界面?这个开源小工具给它换上了毛玻璃
前端·javascript·后端
To_OC9 小时前
LC 15 三数之和:双指针不难,难的是把去重做对
javascript·算法·leetcode
触底反弹9 小时前
🔥 前端也能玩转 AI 流式输出!从二进制流到打字机效果,一篇讲透
javascript·人工智能·node.js
胡萝卜术9 小时前
深度重构:Agent Skills——从 Prompt 工程到能力工程
javascript·架构·github
海上彼尚11 小时前
Nodejs也能写Agent - 16.LangGraph篇 - 条件分支与循环
前端·后端·langchain·node.js
To_OC11 小时前
从 “卡死半天” 到 “打字机效果”:大模型流式输出前端实现全记录
前端·javascript·llm
rockey62712 小时前
基于AScript的JavaScript脚本语言发布啦
javascript·c#·.net·js·script