mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: do not allow edit for setting_storage
This commit is contained in:
1 parent
efb8adfe6d
commit
0c81eea40a
3 files changed
+5
-1
No files matched your search
@@ -67,7 +67,7 @@ export class ApiMixin extends Service {
|
||||
setImmediate = T(setImmediate, clearImmediate);
|
||||
provideModule = T(provideModule);
|
||||
inject = T(inject);
|
||||
broadcast = (event: string, ...payload) => this.ctx.emit('bus/broadcast', event, payload);
|
||||
broadcast = (event: keyof EventMap, ...payload) => this.ctx.emit('bus/broadcast', event, payload);
|
||||
constructor(ctx) {
|
||||
super(ctx, 'api', true);
|
||||
}
|
||||
|
||||
@@ -223,6 +223,7 @@ class HomeSecurityHandler extends Handler {
|
||||
|
||||
function set(s: Setting, key: string, value: any) {
|
||||
if (s) {
|
||||
if (s.family === 'setting_storage') return undefined;
|
||||
if (s.flag & setting.FLAG_DISABLED) return undefined;
|
||||
if ((s.flag & setting.FLAG_SECRET) && !value) return undefined;
|
||||
if (s.type === 'boolean') {
|
||||
|
||||
@@ -28,6 +28,7 @@ export interface EventMap {
|
||||
'app/load/model': () => VoidReturn
|
||||
'app/load/handler': () => VoidReturn
|
||||
'app/load/service': () => VoidReturn
|
||||
'app/ready': () => VoidReturn
|
||||
'app/exit': () => VoidReturn
|
||||
|
||||
'database/connect': (db: Db) => void
|
||||
@@ -36,6 +37,8 @@ export interface EventMap {
|
||||
'system/setting': (args: Record<string, any>) => VoidReturn
|
||||
'bus/broadcast': (event: keyof EventMap, ...args: any[]) => VoidReturn
|
||||
'monitor/update': (type: 'server' | 'judge', $set: any) => VoidReturn
|
||||
'api/update': () => void;
|
||||
'task/daily': () => void;
|
||||
|
||||
'user/message': (uid: number, mdoc: MessageDoc) => void
|
||||
'user/get': (udoc: User) => void
|
||||
|
||||
Reference in new issue
Block a user