fix(admin): restore Vite admin source files
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export const extensionsApiMethods = {
|
||||
/* ================================================================
|
||||
* 扩展&增强 (Extensions)
|
||||
* ================================================================ */
|
||||
|
||||
testIpGeo(ip) { return this.request('/extensions/ip-test', { method: 'POST', data: { ip } }) },
|
||||
testContentAudit(text) { return this.request('/extensions/audit-test', { method: 'POST', data: { text } }) },
|
||||
|
||||
/* AI 辅助 */
|
||||
getAiStatus() { return this.request('/ai/status') },
|
||||
updateAiSettings(data) { return this.request('/ai/settings', { method: 'POST', data }) },
|
||||
generateSeo(data) { return this.request('/ai/seo-generate', { method: 'POST', data }) },
|
||||
suggestSummary(data) { return this.request('/ai/summary-suggest', { method: 'POST', data }) },
|
||||
suggestTags(data) { return this.request('/ai/tags-suggest', { method: 'POST', data }) },
|
||||
}
|
||||
@@ -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 }) }) },
|
||||
}
|
||||
@@ -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) },
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export const paymentApiMethods = {
|
||||
/* ================================================================
|
||||
* 支付&付费 (Payment)
|
||||
* ================================================================ */
|
||||
|
||||
getPaymentOverview() { return this.request('/payment/overview') },
|
||||
}
|
||||
@@ -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,
|
||||
}),
|
||||
})
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
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') },
|
||||
}
|
||||
Reference in New Issue
Block a user