导入 AKSRT 主题开发源码

This commit is contained in:
Claude Code
2026-07-03 22:50:34 +08:00
parent 9681dd3d48
commit 1268a55dd0
595 changed files with 127705 additions and 0 deletions
@@ -0,0 +1,8 @@
export const extensionsApiMethods = {
/* ================================================================
* 扩展&增强 (Extensions)
* ================================================================ */
testIpGeo(ip) { return this.request('/extensions/ip-test', { method: 'POST', body: JSON.stringify({ ip }) }) },
testContentAudit(text) { return this.request('/extensions/audit-test', { method: 'POST', body: JSON.stringify({ text }) }) },
}
+28
View File
@@ -0,0 +1,28 @@
export const globalApiMethods = {
/* ================================================================
* 全局&功能 (Global & Functions)
* ================================================================ */
getMailSettings() { return this.request('/settings/mail') },
saveMailSettings(data) { return this.request('/settings/mail', { method: 'POST', body: JSON.stringify(data) }) },
testMail(to) { return this.request('/mail/test', { method: 'POST', body: JSON.stringify({ to }) }) },
getFooterSettings() { return this.request('/settings/footer') },
saveFooterSettings(data) { return this.request('/settings/footer', { method: 'POST', body: JSON.stringify(data) }) },
getFooterTabbarSettings() { return this.request('/settings/footer-tabbar') },
saveFooterTabbarSettings(data) { return this.request('/settings/footer-tabbar', { method: 'POST', body: JSON.stringify(data) }) },
reorderFooterTabbar(ids) { return this.request('/settings/footer-tabbar/reorder', { method: 'POST', body: JSON.stringify({ ids }) }) },
getFloatingButtons() { return this.request('/settings/floating-buttons') },
saveFloatingButtons(data) { return this.request('/settings/floating-buttons', { method: 'POST', body: JSON.stringify(data) }) },
reorderFloatingButtons(ids) { return this.request('/settings/floating-buttons/reorder', { method: 'POST', body: JSON.stringify({ ids }) }) },
getFriendLinks() { return this.request('/friend-links') },
addFriendLink(data) { return this.request('/friend-links', { method: 'POST', body: JSON.stringify(data) }) },
deleteFriendLink(id) { return this.request(`/friend-links/${id}`, { method: 'DELETE' }) },
reorderFriendLinks(ids) { return this.request('/friend-links/reorder', { method: 'POST', body: JSON.stringify({ ids }) }) },
getCmsFeatures() { return this.request('/settings/cms-features') },
saveCmsFeatures(cms_features) { return this.request('/settings/cms-features', { method: 'POST', body: JSON.stringify({ cms_features }) }) },
}
+19
View File
@@ -0,0 +1,19 @@
import { globalApiMethods } from './global.js'
import { pageDisplayApiMethods } from './page-display.js'
import { permissionsApiMethods } from './permissions.js'
import { usersApiMethods } from './users.js'
import { paymentApiMethods } from './payment.js'
import { extensionsApiMethods } from './extensions.js'
import { toolsApiMethods } from './tools.js'
import { schemaApiMethods } from './schema.js'
export const apiMethods = {
...globalApiMethods,
...pageDisplayApiMethods,
...permissionsApiMethods,
...usersApiMethods,
...paymentApiMethods,
...extensionsApiMethods,
...toolsApiMethods,
...schemaApiMethods,
}
@@ -0,0 +1,30 @@
export const pageDisplayApiMethods = {
/* ================================================================
* 页面&显示 (Page Display)
* ================================================================ */
getHomepageSettings() { return this.request('/settings/homepage') },
saveHomepageSettings(data) { return this.request('/settings/homepage', { method: 'POST', body: JSON.stringify(data) }) },
getHomepageCategories() { return this.request('/homepage/categories') },
getCategoryRecommendSettings() { return this.request('/settings/category-recommend') },
saveCategoryRecommendSettings(data) { return this.request('/settings/category-recommend', { method: 'POST', body: JSON.stringify(data) }) },
getCategories() { return this.request('/categories') },
updateCategoryMeta(id, data) { return this.request(`/categories/${id}/meta`, { method: 'POST', body: JSON.stringify(data) }) },
searchUsers(search = '', number = 20) { return this.request(`/users/search?search=${encodeURIComponent(search)}&number=${number}`) },
getBanners(kind = 'hero') { return this.request(`/banners?kind=${encodeURIComponent(kind)}`) },
createBanner(data) { return this.request('/banners', { method: 'POST', body: JSON.stringify(data) }) },
updateBanner(id, data) { return this.request(`/banners/${id}`, { method: 'PUT', body: JSON.stringify(data) }) },
deleteBanner(id) { return this.request(`/banners/${id}`, { method: 'DELETE' }) },
getHeroes() { return this.getBanners('hero') },
createHero(data) { return this.createBanner({ ...data, kind: 'hero' }) },
updateHero(id, data) { return this.updateBanner(id, { ...data, kind: 'hero' }) },
deleteHero(id) { return this.deleteBanner(id) },
getHomepageBanners() { return this.getBanners('banner') },
createHomepageBanner(data) { return this.createBanner({ ...data, kind: 'banner' }) },
updateHomepageBanner(id, data) { return this.updateBanner(id, { ...data, kind: 'banner' }) },
deleteHomepageBanner(id) { return this.deleteBanner(id) },
}
+7
View File
@@ -0,0 +1,7 @@
export const paymentApiMethods = {
/* ================================================================
* 支付&付费 (Payment)
* ================================================================ */
getPaymentOverview() { return this.request('/payment/overview') },
}
@@ -0,0 +1,17 @@
export const permissionsApiMethods = {
/* ================================================================
* 功能&权限 (Permissions)
* ================================================================ */
getPermissionsAttachmentSettings() { return this.getSchemaPage('permissions', 'attachment') },
savePermissionsAttachmentSettings(data) { return this.saveSchemaPage('permissions', 'attachment', data) },
getPermissionsLoginSettings() { return this.getSchemaPage('permissions', 'login') },
savePermissionsLoginSettings(data) { return this.saveSchemaPage('permissions', 'login', data) },
getPermissionsModerationSettings() { return this.getSchemaPage('permissions', 'moderation') },
savePermissionsModerationSettings(data) { return this.saveSchemaPage('permissions', 'moderation', data) },
getCapabilities() { return this.request('/permissions/capabilities') },
saveCapabilities(user_caps) { return this.request('/permissions/capabilities', { method: 'POST', body: JSON.stringify({ user_caps }) }) },
}
+17
View File
@@ -0,0 +1,17 @@
export const schemaApiMethods = {
getSchema(domain) { return this.request(`/settings/schema/${domain}`) },
getSchemaPage(domain, section) {
return this.request(`/settings/schema/${this.normalizeDomainKey(domain)}/${encodeURIComponent(section)}`)
},
saveSchemaPage(domain, section, data, version = '1.0.0') {
return this.request(`/settings/schema/${this.normalizeDomainKey(domain)}/${encodeURIComponent(section)}`, {
method: 'POST',
body: JSON.stringify({
domain: this.normalizeDomainKey(domain),
section,
data,
version,
}),
})
},
}
+28
View File
@@ -0,0 +1,28 @@
export const toolsApiMethods = {
/* ================================================================
* 扩展&增强 / 备份&导入 (Extensions & Tools)
* ================================================================ */
getHealthEmailVerification() { return this.request('/health/email-verification') },
getUpdateInfo() { return this.request('/tools/update-info') },
detectUpdate() { return this.request('/tools/update-check', { method: 'POST', body: JSON.stringify({}) }) },
dismissUpdate(version) { return this.request('/tools/update-dismiss', { method: 'POST', body: JSON.stringify({ version }) }) },
getEmailRollbackUsers() { return this.request('/email-rollback/users') },
executeEmailRollback(id) { return this.request(`/email-rollback/users/${id}/rollback`, { method: 'POST' }) },
/* ================================================================
* Settings Management (Import / Export / Reset / Health / Schema)
* ================================================================ */
exportSettings() { return this.request('/settings/export') },
importSettings(data) { return this.request('/settings/import', { method: 'POST', body: JSON.stringify(data) }) },
listSettingBackups() { return this.request('/settings/backups') },
createSettingBackup(data = {}) { return this.request('/settings/backups', { method: 'POST', body: JSON.stringify(data) }) },
restoreSettingBackup(id) { return this.request(`/settings/backups/${id}/restore`, { method: 'POST' }) },
deleteSettingBackup(id) { return this.request(`/settings/backups/${id}`, { method: 'DELETE' }) },
resetDomain(domain) { return this.request(`/settings/reset/${domain}`, { method: 'POST' }) },
resetAllSettings() { return this.request('/settings/reset-all', { method: 'POST' }) },
getHealthCheck() { return this.request('/settings/health') },
getMigrationStatus() { return this.request('/settings/migration-status') },
}
+36
View File
@@ -0,0 +1,36 @@
export const usersApiMethods = {
/* ================================================================
* 用户&互动 (User & Interaction)
* ================================================================ */
getAuthSettings() { return this.request('/settings/auth') },
saveAuthSettings(data) { return this.request('/settings/auth', { method: 'POST', body: JSON.stringify(data) }) },
getOAuthSettings() { return this.request('/settings/oauth') },
saveOAuthSettings(data) { return this.request('/settings/oauth', { method: 'POST', body: JSON.stringify(data) }) },
getNotificationSettings() { return this.request('/settings/notifications') },
saveNotificationSettings(data) { return this.request('/settings/notifications', { method: 'POST', body: JSON.stringify(data) }) },
getNotificationOverview(params = {}) {
const qs = new URLSearchParams(params).toString()
return this.request('/notifications/overview' + (qs ? `?${qs}` : ''))
},
markNotificationRead(id) { return this.request('/notifications/mark-read', { method: 'POST', body: JSON.stringify({ id }) }) },
markAllNotificationsRead() { return this.request('/notifications/mark-read', { method: 'POST', body: JSON.stringify({ mark_all: true }) }) },
deleteNotification(id) { return this.request(`/notifications/${id}`, { method: 'DELETE' }) },
runNotificationCleanup() { return this.request('/notifications/cleanup', { method: 'POST', body: JSON.stringify({}) }) },
getCreditSettings() { return this.request('/credits/settings') },
saveCreditSettings(data) { return this.request('/credits/settings', { method: 'POST', body: JSON.stringify(data) }) },
listCreditUsers(params = {}) {
const qs = new URLSearchParams(params).toString()
return this.request('/credits/users' + (qs ? `?${qs}` : ''))
},
adjustUserCredits(id, delta, reason) {
return this.request(`/credits/users/${id}/adjust`, { method: 'POST', body: JSON.stringify({ delta, reason }) })
},
getCreditLog(params = {}) {
const qs = new URLSearchParams(params).toString()
return this.request('/credits/log' + (qs ? `?${qs}` : ''))
},
}