Merge branch 'sprint/178_hufangzhou_api' into 'master'

* Adjust the params of createDemoData when manual import.

See merge request easycorp/zentaopms!1150
This commit is contained in:
朱金勇
2021-12-27 03:37:54 +00:00
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -321,7 +321,7 @@ class api extends control
{
if($type == 'demo')
{
$libID = $this->api->createDemoData();
$libID = $this->api->createDemoData($this->post->name, $this->post->baseUrl);
return $this->sendSuccess(array('locate' => $this->createLink('api', 'index', "libID=$libID")));
}
+1 -1
View File
@@ -741,7 +741,7 @@ class apiModel extends model
* @access public
* @return int
*/
public function createDemoData($name, $baseUrl, $version)
public function createDemoData($name, $baseUrl, $version = '16.0')
{
$firstAccount = $this->dao->select('account')->from(TABLE_USER)->orderBy('id_asc')->limit(1)->fetch('account');
$currentAccount = isset($this->app->user->account) ? $this->app->user->account : $firstAccount;