PKC音色管理后台v1.0.0

This commit is contained in:
curtinlv 2024-11-02 08:34:56 +08:00
parent 05bd4aa961
commit 4311758c29
7 changed files with 23 additions and 7 deletions

1
.env
View File

@ -1 +1,2 @@
PKC_PASSWORD=Abc!@123456
PKC_MY=Abc!@123456

View File

@ -1,6 +1,7 @@
{
"标题": "PKC音色管理后台",
"端口": "39900",
"接口密钥": "",
"users": [
{
"username": "pkc",

View File

@ -36,6 +36,7 @@ PKC_USER = os.environ.get('PKC_USER')
PKC_PASSWORD = os.environ.get('PKC_PASSWORD')
PKC_VERSION = os.environ.get('PKC_VERSION')
PKC_TITLE = os.environ.get('PKC_TITLE')
PKC_MY = os.environ.get('PKC_MY')
if PKC_USER is None:
PKC_USER = userConfig['users'][0]['username']
@ -45,10 +46,19 @@ if PKC_VERSION is None:
PKC_VERSION = 'v1.0.0'
if PKC_TITLE is None:
PKC_TITLE = userConfig['标题']
if PKC_MY is None:
PKC_MY = userConfig['接口密钥']
# 导出 JSON 文件
@app.route('/ysList')
def printYsList():
# return jsonify(read_json_file(JSON_FILE))
if len(PKC_MY) > 0:
if request.method == 'GET':
my = request.args.get('my')
if my != PKC_MY:
return "密钥错误!"
else:
return "没权限访问"
# 将数据转换为格式化的 JSON 字符串
json_data = json.dumps(read_json_file(JSON_FILE), ensure_ascii=False, indent=4)
@ -321,6 +331,7 @@ def dashboard():
curtabName=curtabName,
titleName=PKC_TITLE,
PKC_VERSION=PKC_VERSION,
PKC_MY=PKC_MY,
response=response) # 将 response 传递到模板

View File

@ -653,9 +653,11 @@
}
function getYsList() {
{#var domainName = '{{ domainName }}';#}
{#var mainUrl = domainName.length > 0 ? window.location.protocol+'//'+domainName+':'+window.location.port:window.location.origin;#}
var my = '{{ PKC_MY }}';
var currentUrl = window.location.origin + '/ysList';
if (my.length > 0){
currentUrl = currentUrl + '?my='+my;
}
document.getElementById('urlText').textContent = currentUrl;
document.getElementById('urlModal').style.display = 'flex';

View File

@ -1,7 +1,6 @@
# PKC音色管理后台
```
仅用于PKC音色管理可自定义音色接口地址
```
仅用于PKC音色维护用户可自定义音色后台管理进行音色增删减
![img.png](img.png)
## 一、启动项目
## 1. 使用 Python 启动
@ -43,6 +42,7 @@ services:
- PKC_TITLE=PKC音色管理系统 # 系统名称
- PKC_USER=pkc # 用户名
- PKC_PASSWORD=pkc # 密码,如需带特殊字符用.env引入
- PKC_MY=pkc # 接口密钥,如需带特殊字符用.env引入
volumes:
- ./backup:/app/backup # 音色备份目录
- /etc/localtime:/etc/localtime:ro

View File

@ -9,6 +9,7 @@ services:
- PKC_TITLE=PKC音色管理系统 # 系统名称
- PKC_USER=Curtin # 用户名
- PKC_PASSWORD=${PKC_PASSWORD} # 密码
- PKC_MY=${PKC_MY} # 音色接口密码
volumes:
# - ./ys.json:/app/ys.json # 音色文件
- ./backup:/app/backup # 音色备份目录

BIN
img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 KiB