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

This commit is contained in:
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": {
"post": {
"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": {
"post": {
"security": [
@ -8179,7 +8216,7 @@ var doc = `{
],
"responses": {
"200": {
"description": "OK"
"description": ""
}
},
"x-panel-log": {
@ -12013,6 +12050,9 @@ var doc = `{
"expireDate": {
"type": "string"
},
"group": {
"type": "string"
},
"httpConfig": {
"type": "string"
},
@ -12052,6 +12092,9 @@ var doc = `{
"updatedAt": {
"type": "string"
},
"user": {
"type": "string"
},
"webSiteGroupId": {
"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": {
"type": "object",
"required": [
@ -13643,6 +13705,9 @@ var doc = `{
"expireDate": {
"type": "string"
},
"group": {
"type": "string"
},
"httpConfig": {
"type": "string"
},
@ -13688,6 +13753,9 @@ var doc = `{
"updatedAt": {
"type": "string"
},
"user": {
"type": "string"
},
"webSiteGroupId": {
"type": "integer"
},

View File

@ -922,20 +922,6 @@
}
}
},
"/auth/status": {
"get": {
"description": "判断是否为首次登录",
"tags": [
"Auth"
],
"summary": "Check is First login",
"responses": {
"200": {
"description": ""
}
}
}
},
"/containers": {
"post": {
"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": {
"post": {
"security": [
@ -8165,7 +8202,7 @@
],
"responses": {
"200": {
"description": "OK"
"description": ""
}
},
"x-panel-log": {
@ -11999,6 +12036,9 @@
"expireDate": {
"type": "string"
},
"group": {
"type": "string"
},
"httpConfig": {
"type": "string"
},
@ -12038,6 +12078,9 @@
"updatedAt": {
"type": "string"
},
"user": {
"type": "string"
},
"webSiteGroupId": {
"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": {
"type": "object",
"required": [
@ -13629,6 +13691,9 @@
"expireDate": {
"type": "string"
},
"group": {
"type": "string"
},
"httpConfig": {
"type": "string"
},
@ -13674,6 +13739,9 @@
"updatedAt": {
"type": "string"
},
"user": {
"type": "string"
},
"webSiteGroupId": {
"type": "integer"
},

View File

@ -1730,6 +1730,8 @@ definitions:
type: boolean
expireDate:
type: string
group:
type: string
httpConfig:
type: string
id:
@ -1756,6 +1758,8 @@ definitions:
type: string
updatedAt:
type: string
user:
type: string
webSiteGroupId:
type: integer
webSiteSSL:
@ -2562,6 +2566,19 @@ definitions:
- id
- siteDir
type: object
request.WebsiteUpdateDirPermission:
properties:
group:
type: string
id:
type: integer
user:
type: string
required:
- group
- id
- user
type: object
request.WebsiteWafReq:
properties:
key:
@ -2818,6 +2835,8 @@ definitions:
type: string
expireDate:
type: string
group:
type: string
httpConfig:
type: string
id:
@ -2848,6 +2867,8 @@ definitions:
type: string
updatedAt:
type: string
user:
type: string
webSiteGroupId:
type: integer
webSiteSSL:
@ -3481,15 +3502,6 @@ paths:
summary: User login with mfa
tags:
- Auth
/auth/status:
get:
description: 判断是否为首次登录
responses:
"200":
description: ""
summary: Check is First login
tags:
- Auth
/containers:
post:
consumes:
@ -8069,6 +8081,39 @@ paths:
formatEN: Delete website [domain]
formatZH: 删除网站 [domain]
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:
post:
consumes:
@ -8083,7 +8128,7 @@ paths:
$ref: '#/definitions/request.WebsiteUpdateDir'
responses:
"200":
description: OK
description: ""
security:
- ApiKeyAuth: []
summary: Update Site Dir

View File

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

View File

@ -803,7 +803,7 @@ const message = {
portChangeHelper: '服务端口修改需要重启服务是否继续',
entrance: '安全入口',
entranceHelper: '开启安全入口后只能通过指定安全入口登录面板',
entranceError: '请输入 8 位安全登录入口仅支持输入数字或字母',
entranceError: '请输入 6-10 位安全登录入口仅支持输入数字或字母',
theme: '主题颜色',
componentSize: '组件大小',
dark: '暗色',

View File

@ -36,7 +36,7 @@
type="password"
show-password
clearable
v-model.number="form.securityEntrance"
v-model="form.securityEntrance"
>
<template #append>
<el-button style="width: 85px" @click="onSaveEntrance" icon="Collection">
@ -324,7 +324,7 @@ const handleEntrance = 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 === '') {
codeError.value = true;
return;