|
|
|
@ -18,6 +18,7 @@ export const API_UPLOAD_AVATAR = '/api/v1/settings/add-avatar';
|
|
|
|
|
export const API_UPLOAD_BACKGROUND = '/api/v1/settings/add-feature-background';
|
|
|
|
|
export const API_PUBLISH_PAGES = '/api/v1/settings/publish-pages';
|
|
|
|
|
export const API_NAV_SYNC = '/api/v1/settings/nav-sync';
|
|
|
|
|
export const API_REINDEX_PAGES = '/api/v1/settings/reindex';
|
|
|
|
|
export const API_CREATE_BACKUP = '/api/v1/backup/create';
|
|
|
|
|
export const API_DOWNLOAD_BACKUP = '/api/v1/backup/download';
|
|
|
|
|
export const API_RESTORE_BACKUP = '/api/v1/backup/restore';
|
|
|
|
@ -244,6 +245,24 @@ export default class APIUtils {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleReindex(data) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
this._request(
|
|
|
|
|
API_REINDEX_PAGES,
|
|
|
|
|
DataEvent.API_REINDEX_PAGES,
|
|
|
|
|
REQUEST_TYPE_POST,
|
|
|
|
|
CONTENT_TYPE_JSON,
|
|
|
|
|
data
|
|
|
|
|
)
|
|
|
|
|
.then(result => {
|
|
|
|
|
resolve(result);
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
reject(err);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//--------------------------
|
|
|
|
|
// private
|
|
|
|
|
//--------------------------
|
|
|
|
@ -276,7 +295,8 @@ export default class APIUtils {
|
|
|
|
|
eventType === DataEvent.API_PAGE_DELETE ||
|
|
|
|
|
eventType === DataEvent.API_RENDER_PAGES ||
|
|
|
|
|
eventType === DataEvent.API_BACKUP_CREATE ||
|
|
|
|
|
eventType === DataEvent.API_BACKUP_RESTORE
|
|
|
|
|
eventType === DataEvent.API_BACKUP_RESTORE ||
|
|
|
|
|
eventType === DataEvent.API_REINDEX_PAGES
|
|
|
|
|
)
|
|
|
|
|
request.setRequestHeader('x-access-token', self.token);
|
|
|
|
|
|
|
|
|
|