fix(homepage): unify runtime rendering contract
This commit is contained in:
@@ -281,27 +281,19 @@ async function loadSettings() {
|
||||
const res = await api.getHomepageSettings()
|
||||
const d = res?.data || {}
|
||||
|
||||
form.home_posts_list_s = d.home_posts_list_s !== false && d.home_posts_list_enabled !== false
|
||||
form.home_list1_orderby_s = d.home_list1_orderby_s !== false && d.home_list_sort_enabled !== false
|
||||
form.home_posts_list_s = d.home_posts_list_s !== false
|
||||
form.home_list1_orderby_s = d.home_list1_orderby_s !== false
|
||||
const orderOpt = d.home_list1_orderby_option && typeof d.home_list1_orderby_option === 'object' ? d.home_list1_orderby_option : {}
|
||||
form.home_list1_orderby_option = {
|
||||
orderby: orderOpt.orderby || d.homepage_default_sort || 'modified',
|
||||
orderby: orderOpt.orderby || 'date',
|
||||
options: Array.isArray(orderOpt.options) && orderOpt.options.length
|
||||
? orderOpt.options
|
||||
: (Array.isArray(d.home_list_sort_options) && d.home_list_sort_options.length
|
||||
? d.home_list_sort_options
|
||||
: ['modified', 'date', 'views', 'likes', 'comments']),
|
||||
: ['modified', 'date', 'views', 'likes', 'comments'],
|
||||
}
|
||||
form.index_list_title = d.index_list_title || d.home_list_title || '最新发布'
|
||||
form.home_exclude_posts = Array.isArray(d.home_exclude_posts)
|
||||
? d.home_exclude_posts
|
||||
: (Array.isArray(d.home_exclude_post_ids) ? d.home_exclude_post_ids : [])
|
||||
form.home_exclude_cats = Array.isArray(d.home_exclude_cats)
|
||||
? d.home_exclude_cats
|
||||
: (Array.isArray(d.home_exclude_category_ids) ? d.home_exclude_category_ids : [])
|
||||
form.home_lists = Array.isArray(d.home_lists)
|
||||
? d.home_lists
|
||||
: (Array.isArray(d.homepage_tabs) ? d.homepage_tabs : [])
|
||||
form.index_list_title = d.index_list_title || '最新发布'
|
||||
form.home_exclude_posts = Array.isArray(d.home_exclude_posts) ? d.home_exclude_posts : []
|
||||
form.home_exclude_cats = Array.isArray(d.home_exclude_cats) ? d.home_exclude_cats : []
|
||||
form.home_lists = Array.isArray(d.home_lists) ? d.home_lists : []
|
||||
form.homepage_card_style = d.homepage_card_style || 'default'
|
||||
form.homepage_multi_thumb_enabled = d.homepage_multi_thumb_enabled !== false
|
||||
form.homepage_multi_thumb_min_images = d.homepage_multi_thumb_min_images || 3
|
||||
|
||||
Reference in New Issue
Block a user