/** * 从服务器加载动态配置 */ import { fetchSceneTypes, fetchUserConfig } from '../services/config/fetchConfig'; const app = getApp(); function loadConfig() { const pList = []; const userId = app.globalData.accessToken.userId; const f1 = fetchSceneTypes({ userId }).then(res => { wx.setStorage({ key: 'scene_types', data: res.data, }); }); const f2 = fetchUserConfig({ userId }); pList.push(f1, f2); return Promise.all(pList); } export { loadConfig };