public function actionImportConfig() { $res = WebUtils::initWebApiResult(); $errMsgs = array(0 => '导入配置成功', 1 => '导入配置失败'); $res = WebUtils::makeWebApiResult($res, 1, $errMsgs[1]); if (!empty($_FILES) && count($_FILES) && is_uploaded_file($_FILES['file']['tmp_name']) && !$_FILES['file']['error']) { $config = $this->_decodeConfig(file_get_contents($_FILES['file']['tmp_name'])); if (!empty($config)) { AppbymeUIDiyModel::saveNavigationInfo($config['navigation'], true); AppbymeUIDiyModel::saveModules($config['moduleList'], true); $res = WebUtils::makeWebApiResult($res, 0, $errMsgs[0]); } } WebUtils::outputWebApi($res, 'utf-8'); }