fix: 安全入口长度限制改为 6-10 位

pull/774/head
ssongliu 2023-04-17 13:57:41 +08:00 committed by ssongliu
parent 17dd07fe32
commit bd8d96be4d
6 changed files with 227 additions and 45 deletions

View File

@ -936,20 +936,6 @@ var doc = `{
} }
} }
}, },
"/auth/status": {
"get": {
"description": "判断是否为首次登录",
"tags": [
"Auth"
],
"summary": "Check is First login",
"responses": {
"200": {
"description": ""
}
}
}
},
"/containers": { "/containers": {
"post": { "post": {
"security": [ "security": [
@ -8151,6 +8137,57 @@ var doc = `{
} }
} }
}, },
"/websites/dir/permission": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "更新网站目录权限",
"consumes": [
"application/json"
],
"tags": [
"Website"
],
"summary": "Update Site Dir permission",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.WebsiteUpdateDirPermission"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"x-panel-log": {
"BeforeFuntions": [
{
"db": "websites",
"input_colume": "id",
"input_value": "id",
"isList": false,
"output_colume": "primary_domain",
"output_value": "domain"
}
],
"bodyKeys": [
"id"
],
"formatEN": "Update domain [domain] dir permission",
"formatZH": "更新网站 [domain] 目录权限",
"paramKeys": []
}
}
},
"/websites/dir/update": { "/websites/dir/update": {
"post": { "post": {
"security": [ "security": [
@ -8179,7 +8216,7 @@ var doc = `{
], ],
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": ""
} }
}, },
"x-panel-log": { "x-panel-log": {
@ -12013,6 +12050,9 @@ var doc = `{
"expireDate": { "expireDate": {
"type": "string" "type": "string"
}, },
"group": {
"type": "string"
},
"httpConfig": { "httpConfig": {
"type": "string" "type": "string"
}, },
@ -12052,6 +12092,9 @@ var doc = `{
"updatedAt": { "updatedAt": {
"type": "string" "type": "string"
}, },
"user": {
"type": "string"
},
"webSiteGroupId": { "webSiteGroupId": {
"type": "integer" "type": "integer"
}, },
@ -13257,6 +13300,25 @@ var doc = `{
} }
} }
}, },
"request.WebsiteUpdateDirPermission": {
"type": "object",
"required": [
"group",
"id",
"user"
],
"properties": {
"group": {
"type": "string"
},
"id": {
"type": "integer"
},
"user": {
"type": "string"
}
}
},
"request.WebsiteWafReq": { "request.WebsiteWafReq": {
"type": "object", "type": "object",
"required": [ "required": [
@ -13643,6 +13705,9 @@ var doc = `{
"expireDate": { "expireDate": {
"type": "string" "type": "string"
}, },
"group": {
"type": "string"
},
"httpConfig": { "httpConfig": {
"type": "string" "type": "string"
}, },
@ -13688,6 +13753,9 @@ var doc = `{
"updatedAt": { "updatedAt": {
"type": "string" "type": "string"
}, },
"user": {
"type": "string"
},
"webSiteGroupId": { "webSiteGroupId": {
"type": "integer" "type": "integer"
}, },

View File

@ -922,20 +922,6 @@
} }
} }
}, },
"/auth/status": {
"get": {
"description": "判断是否为首次登录",
"tags": [
"Auth"
],
"summary": "Check is First login",
"responses": {
"200": {
"description": ""
}
}
}
},
"/containers": { "/containers": {
"post": { "post": {
"security": [ "security": [
@ -8137,6 +8123,57 @@
} }
} }
}, },
"/websites/dir/permission": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "更新网站目录权限",
"consumes": [
"application/json"
],
"tags": [
"Website"
],
"summary": "Update Site Dir permission",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/request.WebsiteUpdateDirPermission"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"x-panel-log": {
"BeforeFuntions": [
{
"db": "websites",
"input_colume": "id",
"input_value": "id",
"isList": false,
"output_colume": "primary_domain",
"output_value": "domain"
}
],
"bodyKeys": [
"id"
],
"formatEN": "Update domain [domain] dir permission",
"formatZH": "更新网站 [domain] 目录权限",
"paramKeys": []
}
}
},
"/websites/dir/update": { "/websites/dir/update": {
"post": { "post": {
"security": [ "security": [
@ -8165,7 +8202,7 @@
], ],
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": ""
} }
}, },
"x-panel-log": { "x-panel-log": {
@ -11999,6 +12036,9 @@
"expireDate": { "expireDate": {
"type": "string" "type": "string"
}, },
"group": {
"type": "string"
},
"httpConfig": { "httpConfig": {
"type": "string" "type": "string"
}, },
@ -12038,6 +12078,9 @@
"updatedAt": { "updatedAt": {
"type": "string" "type": "string"
}, },
"user": {
"type": "string"
},
"webSiteGroupId": { "webSiteGroupId": {
"type": "integer" "type": "integer"
}, },
@ -13243,6 +13286,25 @@
} }
} }
}, },
"request.WebsiteUpdateDirPermission": {
"type": "object",
"required": [
"group",
"id",
"user"
],
"properties": {
"group": {
"type": "string"
},
"id": {
"type": "integer"
},
"user": {
"type": "string"
}
}
},
"request.WebsiteWafReq": { "request.WebsiteWafReq": {
"type": "object", "type": "object",
"required": [ "required": [
@ -13629,6 +13691,9 @@
"expireDate": { "expireDate": {
"type": "string" "type": "string"
}, },
"group": {
"type": "string"
},
"httpConfig": { "httpConfig": {
"type": "string" "type": "string"
}, },
@ -13674,6 +13739,9 @@
"updatedAt": { "updatedAt": {
"type": "string" "type": "string"
}, },
"user": {
"type": "string"
},
"webSiteGroupId": { "webSiteGroupId": {
"type": "integer" "type": "integer"
}, },

View File

@ -1730,6 +1730,8 @@ definitions:
type: boolean type: boolean
expireDate: expireDate:
type: string type: string
group:
type: string
httpConfig: httpConfig:
type: string type: string
id: id:
@ -1756,6 +1758,8 @@ definitions:
type: string type: string
updatedAt: updatedAt:
type: string type: string
user:
type: string
webSiteGroupId: webSiteGroupId:
type: integer type: integer
webSiteSSL: webSiteSSL:
@ -2562,6 +2566,19 @@ definitions:
- id - id
- siteDir - siteDir
type: object type: object
request.WebsiteUpdateDirPermission:
properties:
group:
type: string
id:
type: integer
user:
type: string
required:
- group
- id
- user
type: object
request.WebsiteWafReq: request.WebsiteWafReq:
properties: properties:
key: key:
@ -2818,6 +2835,8 @@ definitions:
type: string type: string
expireDate: expireDate:
type: string type: string
group:
type: string
httpConfig: httpConfig:
type: string type: string
id: id:
@ -2848,6 +2867,8 @@ definitions:
type: string type: string
updatedAt: updatedAt:
type: string type: string
user:
type: string
webSiteGroupId: webSiteGroupId:
type: integer type: integer
webSiteSSL: webSiteSSL:
@ -3481,15 +3502,6 @@ paths:
summary: User login with mfa summary: User login with mfa
tags: tags:
- Auth - Auth
/auth/status:
get:
description: 判断是否为首次登录
responses:
"200":
description: ""
summary: Check is First login
tags:
- Auth
/containers: /containers:
post: post:
consumes: consumes:
@ -8069,6 +8081,39 @@ paths:
formatEN: Delete website [domain] formatEN: Delete website [domain]
formatZH: 删除网站 [domain] formatZH: 删除网站 [domain]
paramKeys: [] paramKeys: []
/websites/dir/permission:
post:
consumes:
- application/json
description: 更新网站目录权限
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/request.WebsiteUpdateDirPermission'
responses:
"200":
description: ""
security:
- ApiKeyAuth: []
summary: Update Site Dir permission
tags:
- Website
x-panel-log:
BeforeFuntions:
- db: websites
input_colume: id
input_value: id
isList: false
output_colume: primary_domain
output_value: domain
bodyKeys:
- id
formatEN: Update domain [domain] dir permission
formatZH: 更新网站 [domain] 目录权限
paramKeys: []
/websites/dir/update: /websites/dir/update:
post: post:
consumes: consumes:
@ -8083,7 +8128,7 @@ paths:
$ref: '#/definitions/request.WebsiteUpdateDir' $ref: '#/definitions/request.WebsiteUpdateDir'
responses: responses:
"200": "200":
description: OK description: ""
security: security:
- ApiKeyAuth: [] - ApiKeyAuth: []
summary: Update Site Dir summary: Update Site Dir

View File

@ -853,8 +853,9 @@ const message = {
safe: 'Security', safe: 'Security',
safeEntrance: 'Security entrance', safeEntrance: 'Security entrance',
safeEntranceHelper: entranceHelper: 'Enabling secure entry will only allow logging in to the panel through specified secure entry.',
'Panel management portal. You can log in to the panel only through a specified security portal, for example: onepanel', entranceError:
'Please enter a secure login entry point of 6-10 characters, only numbers or letters are supported.',
expirationTime: 'Expiration Time', expirationTime: 'Expiration Time',
unSetting: 'Not Set', unSetting: 'Not Set',
noneSetting: noneSetting:

View File

@ -803,7 +803,7 @@ const message = {
portChangeHelper: '', portChangeHelper: '',
entrance: '', entrance: '',
entranceHelper: '', entranceHelper: '',
entranceError: ' 8 ', entranceError: ' 6-10 ',
theme: '', theme: '',
componentSize: '', componentSize: '',
dark: '', dark: '',

View File

@ -36,7 +36,7 @@
type="password" type="password"
show-password show-password
clearable clearable
v-model.number="form.securityEntrance" v-model="form.securityEntrance"
> >
<template #append> <template #append>
<el-button style="width: 85px" @click="onSaveEntrance" icon="Collection"> <el-button style="width: 85px" @click="onSaveEntrance" icon="Collection">
@ -324,7 +324,7 @@ const handleEntrance = async () => {
}; };
const onSaveEntrance = async () => { const onSaveEntrance = async () => {
const reg = /^[A-Za-z0-9]{8}$/; const reg = /^[A-Za-z0-9]{6,10}$/;
if ((!reg.test(form.securityEntrance) && form.securityEntrance !== '') || form.securityEntrance === '') { if ((!reg.test(form.securityEntrance) && form.securityEntrance !== '') || form.securityEntrance === '') {
codeError.value = true; codeError.value = true;
return; return;