增加备案号
This commit is contained in:
1 parent
888e1e56f5
commit
f133288586
7 files changed
+53
-2
No files matched your search
+9
-1
@@ -21,7 +21,7 @@ else:
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
file_handler = RotatingFileHandler('app.log', maxBytes=10485760, backupCount=10)
|
||||
file_handler = RotatingFileHandler(os.path.join(BASE_DIR, 'app.log'), maxBytes=10485760, backupCount=10)
|
||||
file_handler.setFormatter(logging.Formatter(
|
||||
'%(asctime)s %(levelname)s: %(message)s'
|
||||
))
|
||||
@@ -37,6 +37,8 @@ CORS(app)
|
||||
|
||||
# ==================== 配置文件加载 ====================
|
||||
CONFIG_FILE = args.config
|
||||
if not os.path.isabs(CONFIG_FILE):
|
||||
CONFIG_FILE = os.path.join(BASE_DIR, CONFIG_FILE)
|
||||
|
||||
file_config = {
|
||||
'server': {'host': '0.0.0.0', 'port': '5000'},
|
||||
@@ -54,6 +56,8 @@ if os.path.exists(CONFIG_FILE):
|
||||
file_config[section][key] = value
|
||||
|
||||
HTML_ROOT_DIR = file_config['directory']['root']
|
||||
if HTML_ROOT_DIR and not os.path.isabs(HTML_ROOT_DIR):
|
||||
HTML_ROOT_DIR = os.path.join(BASE_DIR, HTML_ROOT_DIR)
|
||||
FILESYSTEM_ENABLED = bool(HTML_ROOT_DIR and HTML_ROOT_DIR.strip())
|
||||
|
||||
if FILESYSTEM_ENABLED:
|
||||
@@ -67,6 +71,10 @@ if FILESYSTEM_ENABLED:
|
||||
SSL_ENABLED = file_config['ssl'].get('enabled', 'false').lower() == 'true'
|
||||
SSL_CERT_FILE = file_config['ssl'].get('cert_file', 'cert.pem')
|
||||
SSL_KEY_FILE = file_config['ssl'].get('key_file', 'key.pem')
|
||||
if not os.path.isabs(SSL_CERT_FILE):
|
||||
SSL_CERT_FILE = os.path.join(BASE_DIR, SSL_CERT_FILE)
|
||||
if not os.path.isabs(SSL_KEY_FILE):
|
||||
SSL_KEY_FILE = os.path.join(BASE_DIR, SSL_KEY_FILE)
|
||||
|
||||
# 视图文件名:根路径与目录访问时固定返回此静态文件,由前端 JS 调用 /api/filelist 拉取数据
|
||||
VIEW_FILE = '__view.html'
|
||||
|
||||
@@ -43,6 +43,10 @@
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">蜀ICP备2024107064号-2</a>
|
||||
</footer>
|
||||
|
||||
<script src="js/view.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -50,7 +50,8 @@
|
||||
body {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', Roboto, Arial, sans-serif;
|
||||
@@ -245,6 +246,21 @@ blockquote {
|
||||
color: var(--fg-secondary);
|
||||
}
|
||||
|
||||
/* ===== Footer ===== */
|
||||
.footer {
|
||||
margin-top: auto;
|
||||
padding-top: 1.5rem;
|
||||
text-align: center;
|
||||
font-size: 0.75rem;
|
||||
color: var(--muted);
|
||||
}
|
||||
.footer a {
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
transition: color 0.15s;
|
||||
}
|
||||
.footer a:hover { color: var(--accent); }
|
||||
|
||||
/* ===== Responsive ===== */
|
||||
@media (max-width: 480px) {
|
||||
body { padding: 1rem 0.8rem; }
|
||||
|
||||
@@ -331,6 +331,20 @@ body {
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
/* ===== 页脚 ===== */
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 24px 20px 32px;
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
.footer a {
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
transition: color 0.15s;
|
||||
}
|
||||
.footer a:hover { color: var(--accent); }
|
||||
|
||||
/* ===== 响应式 ===== */
|
||||
@media (max-width: 480px) {
|
||||
.header { padding: 0 14px; height: 50px; }
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
<script src="js/validation.js"></script>
|
||||
<script src="js/dnfs.js"></script>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">蜀ICP备2024107064号-2</a>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -39,6 +39,9 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">蜀ICP备2024107064号-2</a>
|
||||
</footer>
|
||||
<script src="js/validation.js"></script>
|
||||
<script src="js/login.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">蜀ICP备2024107064号-2</a>
|
||||
</footer>
|
||||
<script src="js/validation.js"></script>
|
||||
<script src="js/register.js?v=6"></script>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user