mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
pref: 安全特性支持,站点隐藏功能
This commit is contained in:
@@ -66,10 +66,15 @@ export const Constants = {
|
||||
code: 404,
|
||||
message: '页面/文件/资源不存在',
|
||||
},
|
||||
|
||||
preview: {
|
||||
code: 10001,
|
||||
message: '对不起,预览环境不允许修改此数据',
|
||||
},
|
||||
siteOff:{
|
||||
code: 10010,
|
||||
message: '站点已关闭',
|
||||
},
|
||||
openKeyError: {
|
||||
code: 20000,
|
||||
message: 'ApiToken错误',
|
||||
|
||||
@@ -7,3 +7,4 @@ export * from './vip-exception.js';
|
||||
export * from './common-exception.js';
|
||||
export * from './not-found-exception.js';
|
||||
export * from './param-exception.js';
|
||||
export * from './site-off-exception.js';
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Constants } from '../constants.js';
|
||||
import { BaseException } from './base-exception.js';
|
||||
/**
|
||||
*/
|
||||
export class SiteOffException extends BaseException {
|
||||
constructor(message) {
|
||||
super('SiteOffException', Constants.res.siteOff.code, message ? message : Constants.res.siteOff.message);
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ export class SysSuiteSetting extends BaseSettings {
|
||||
static __key__ = 'sys.suite';
|
||||
static __access__ = 'private';
|
||||
|
||||
enabled = false;
|
||||
enabled:boolean = false;
|
||||
|
||||
registerGift?: {
|
||||
productId: number;
|
||||
@@ -180,3 +180,25 @@ export class SysSuiteSetting extends BaseSettings {
|
||||
|
||||
intro?: string;
|
||||
}
|
||||
|
||||
|
||||
export type SiteHidden = {
|
||||
enabled: boolean;
|
||||
openPath?: string;
|
||||
//md5 hash 两次后保存
|
||||
openPassword?: string;
|
||||
autoHiddenTimes?: number;
|
||||
hiddenOpenApi?: boolean
|
||||
};
|
||||
export class SysSafeSetting extends BaseSettings {
|
||||
static __title__ = '站点安全设置';
|
||||
static __key__ = 'sys.safe';
|
||||
static __access__ = 'private';
|
||||
|
||||
// 站点隐藏
|
||||
hidden:SiteHidden = {
|
||||
enabled: false,
|
||||
hiddenOpenApi:false,
|
||||
autoHiddenTimes: 5,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user