30 lines
618 B
JavaScript
Raw Normal View History

2025-10-16 21:07:43 +08:00
import { defineStore } from 'pinia';
import app from './app';
const sys = defineStore({
id: 'sys',
state: () => ({
2025-10-22 23:06:43 +08:00
theme: 'blue', // ⭐ 主题强制设置为蓝色
2025-10-16 21:07:43 +08:00
mode: 'light', // 明亮模式、暗黑模式(暂未支持)
modeAuto: false, // 跟随系统
fontSize: 1, // 设置默认字号等级(0-4)
}),
getters: {},
actions: {
setTheme(theme = '') {
2025-10-22 23:06:43 +08:00
// ⭐ 强制使用蓝色主题,忽略所有参数
this.theme = 'blue';
2025-10-16 21:07:43 +08:00
},
},
persist: {
enabled: true,
strategies: [
{
key: 'sys-store',
},
],
},
});
export default sys;