refactor(database): 迁移到SQLite并清理旧MySQL相关代码
移除MySQL相关依赖和配置,完全迁移到SQLite数据库 删除不再需要的MySQL迁移脚本和备份文件 更新README文档说明新的数据库架构 在init_db.js中整合教师和系统设置表的初始化逻辑
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
const express = require('express');
|
||||
const cors = require('cors');
|
||||
const session = require('express-session');
|
||||
// const MySQLStore = require('express-mysql-session')(session);
|
||||
const path = require('path');
|
||||
require('dotenv').config();
|
||||
|
||||
@@ -27,26 +26,9 @@ app.use(cors({
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
|
||||
// Session
|
||||
/*
|
||||
const sessionStore = new MySQLStore({
|
||||
expiration: 86400000,
|
||||
createDatabaseTable: true,
|
||||
schema: {
|
||||
tableName: 'sessions',
|
||||
columnNames: {
|
||||
session_id: 'session_id',
|
||||
expires: 'expires',
|
||||
data: 'data'
|
||||
}
|
||||
}
|
||||
}, db.pool);
|
||||
*/
|
||||
|
||||
app.use(session({
|
||||
key: 'session_cookie',
|
||||
secret: process.env.SESSION_SECRET || 'your-secret-key',
|
||||
// store: sessionStore, // Use MemoryStore for SQLite migration simplification
|
||||
resave: false,
|
||||
saveUninitialized: false,
|
||||
cookie: {
|
||||
|
||||
Reference in New Issue
Block a user