添加审核不展示二维码的功能
This commit is contained in:
@@ -35,17 +35,22 @@ export const useDictionaryStore = create<DictionaryState>()((set, get) => ({
|
||||
set({ isLoading: true, error: null })
|
||||
|
||||
try {
|
||||
const keys = 'publishing_requirements,court_type,court_surface,supplementary_information,game_play,fabu_tip,supported_cities,bannerListImage,bannerDetailImage,bannerListIndex';
|
||||
const keys = 'publishing_requirements,court_type,court_surface,supplementary_information,game_play,fabu_tip,supported_cities,show_home_qrcode,bannerListImage,bannerDetailImage,bannerListIndex';
|
||||
const response = await commonApi.getDictionaryManyKey(keys)
|
||||
|
||||
if (response.code === 0 && response.data) {
|
||||
const dictionaryData = {};
|
||||
const dictionaryData: DictionaryData = {};
|
||||
keys.split(',').forEach(key => {
|
||||
const list = response.data[key];
|
||||
const raw = response.data[key];
|
||||
// 单值配置:首页是否展示二维码(1/0 或 true/false)
|
||||
if (key === 'show_home_qrcode') {
|
||||
dictionaryData[key] = raw === '1' || raw === 1 || raw === true;
|
||||
return;
|
||||
}
|
||||
// supported_cities 格式如 "上海市||北京市",用 || 分割
|
||||
const listData = key === 'supported_cities'
|
||||
? (list ? String(list).split('||').map((s) => s.trim()).filter(Boolean) : [])
|
||||
: (list ? list.split('|') : []);
|
||||
? (raw ? String(raw).split('||').map((s) => s.trim()).filter(Boolean) : [])
|
||||
: (raw ? String(raw).split('|') : []);
|
||||
dictionaryData[key] = listData;
|
||||
})
|
||||
set({
|
||||
|
||||
Reference in New Issue
Block a user