
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@gsp-sys/stores
Advanced tools
共享状态管理库,基于Pinia实现,为微应用框架提供统一的状态管理解决方案。
标签页管理Store,用于管理应用中的标签页状态。
状态:
activeTab - 当前激活的标签页tabsList - 所有标签页列表installAppMap - 已安装的应用映射keepAliveList - 需要保持状态的页面globalData - 全局数据,包括:
number - 数值showTabBar - 是否显示标签栏(仍保留在tabsStore中)使用方法:
import { useTabsStore } from '@gsp-sys/stores';
const tabsStore = useTabsStore();
// 获取激活的标签页
const activeTab = tabsStore.activeTab;
// 获取所有标签页
const allTabs = tabsStore.tabsList;
// 获取全局数据
const globalData = tabsStore.globalData;
公共上下文存储,用于管理应用的公共上下文信息,包括国际化和主题变量。
状态:
currentLocale - 当前语言代码('zh'或'en')primaryColor - 主题主色globalContextData - 全局上下文数据,包括:
theme_primary_color - 主题主色language - 当前语言themeName - 主题名称isInitialized - 是否已初始化计算属性:
locale - 当前语言(别名)primaryColorValue - 主题主色(别名)globalData - 全局数据(别名)currentTheme - 当前主题名称方法:
setLocale(locale) - 设置当前语言updateLanguage(lang) - 更新语言(兼容原方法名)setPrimaryColor(color) - 设置主题主色initContext() - 初始化上下文设置使用方法:
import { useContextStore } from '@gsp-sys/stores';
const contextStore = useContextStore();
// 设置语言
contextStore.setLocale('en');
// 更新语言(兼容方法)
contextStore.updateLanguage('zh');
// 设置主题主色
contextStore.setPrimaryColor('#2A87FF');
// 获取当前语言
const currentLang = contextStore.currentLocale;
用户状态Store,用于管理用户相关的状态。
状态:
userInfo - 用户信息token - 认证令牌计算属性:
isLoggedIn - 是否已登录hasRole(role) - 检查用户是否拥有指定角色方法:
login(token, userInfo) - 登录logout() - 登出updateUserInfo(info) - 更新用户信息使用方法:
import { useUserStore } from '@gsp-sys/stores';
const userStore = useUserStore();
// 登录
userStore.login('token-value', { id: '1', name: 'User', roles: ['admin'] });
// 检查是否登录
if (userStore.isLoggedIn) {
// 执行登录后的操作
}
// 检查权限
if (userStore.hasRole('admin')) {
// 显示管理员功能
}
// 登出
userStore.logout();
FAQs
We found that @gsp-sys/stores demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.