Initial commit: 心理咨询预约系统
PHP 前后端一体:首页咨询师列表、预约表单、管理后台、二维码准入与邮件通知;敏感配置与提交数据通过 .gitignore 排除。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
28
js/config-loader.js
Normal file
28
js/config-loader.js
Normal file
@@ -0,0 +1,28 @@
|
||||
let appConfigCache = null;
|
||||
let doctorsCache = null;
|
||||
let topicsCache = null;
|
||||
|
||||
async function loadAppConfig() {
|
||||
if (appConfigCache) return appConfigCache;
|
||||
const data = await apiGet("config.php");
|
||||
appConfigCache = data;
|
||||
return data;
|
||||
}
|
||||
|
||||
async function loadDoctors() {
|
||||
if (doctorsCache) return doctorsCache;
|
||||
const res = await apiGet("doctors.php");
|
||||
doctorsCache = res.data || [];
|
||||
return doctorsCache;
|
||||
}
|
||||
|
||||
async function loadTopics() {
|
||||
if (topicsCache) return topicsCache;
|
||||
const res = await apiGet("topics.php");
|
||||
topicsCache = res.data || [];
|
||||
return topicsCache;
|
||||
}
|
||||
|
||||
function getDoctorById(doctors, id) {
|
||||
return doctors.find((d) => d.id === id) || null;
|
||||
}
|
||||
Reference in New Issue
Block a user