Skip to content

Commit

Permalink
刷版本号到 v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
WangNingkai committed Nov 9, 2018
1 parent 3b44eef commit b6ad89e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
全新路径显示(原先模式的图床路径会失效,请谨慎升级)
- **2018.10.28 / v3.0**
抛弃数据库,数据json格式保存
- **2018.11.02 to now / v3.0**
- **2018.11.02 to 11.09 / v3.1**

- 重构部分接口逻辑,减少composer依赖
- 添加离线下载(个人版)
Expand Down
41 changes: 34 additions & 7 deletions app/Console/Commands/OneDrive/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,32 +64,41 @@ public function handle()
$this->v_1_1();
$this->v_1_2();
$this->v_2_0();
$result = $this->v_3_0();
$this->v_3_0();
$result = $this->v_3_1();
break;
case 'v1.0':
$this->v_1_1();
$this->v_1_2();
$this->v_2_0();
$result = $this->v_3_0();
$this->v_3_0();
$result = $this->v_3_1();
break;
case 'v1.1':
$this->v_1_2();
$this->v_2_0();
$result = $this->v_3_0();
$this->v_3_0();
$result = $this->v_3_1();
break;
case 'v1.2':
$this->v_2_0();
$result = $this->v_3_0();
$this->v_3_0();
$result = $this->v_3_1();
break;
case 'v2.0':
$result = $this->v_3_0();
$this->v_3_0();
$result = $this->v_3_1();
break;
case 'v3.0':
$result = $this->v_3_1();
break;
default:
$this->v_1_0();
$this->v_1_1();
$this->v_1_2();
$this->v_2_0();
$result = $this->v_3_0();
$this->v_3_0();
$result = $this->v_3_1();
}
Artisan::call('cache:clear');
$this->info($result['status'] . ':' . $result['msg']);
Expand Down Expand Up @@ -195,7 +204,25 @@ public function v_3_0()
$this->info('创建完成!');
};
$saved = Tool::saveConfig($data);
return $saved ? $this->returnStatus('更新成功,version=v3.0,请手动执行chmod 777 storage/app/config.json '.PHP_EOL.' 并移除原数据库 rm -f database/database.sqlite') : $this->returnStatus('更新失败,数据迁移失败,请手动迁移', false);
return $saved ? $this->returnStatus('更新成功,version=v3.0,请手动执行chmod 777 storage/app/config.json ' . PHP_EOL . ' 并移除原数据库 rm -f database/database.sqlite') : $this->returnStatus('更新失败,数据迁移失败,请手动迁移', false);
}

/**
* @return array
*/
public function v_3_1()
{
if (!file_exists(storage_path('app/config.json'))) {
$this->warn('未检测到配置文件!正在创建配置文件...');
copy(storage_path('app/example.config.json'), storage_path('app/config.json'));
$this->info('创建完成!');
$config = Tool::config();
} else {
$config = Tool::config();
$config = array_merge($config, ['app_version' => 'v3.1']);
}
$saved = Tool::saveConfig($config);
return $saved ? $this->returnStatus('更新成功,version=v3.1') : $this->returnStatus('更新失败,数据迁移失败,请手动迁移', false);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Helpers/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Constants
{
const LATEST_VERSION = 'v3.0';
const LATEST_VERSION = 'v3.1';

const API_VERSION = 'v1.0';
const REST_ENDPOINT = 'https://graph.microsoft.com/';
Expand Down
2 changes: 1 addition & 1 deletion storage/app/example.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"app_version": "v3.0",
"app_version": "v3.1",
"client_id": "",
"client_secret": "",
"redirect_uri": "",
Expand Down

0 comments on commit b6ad89e

Please sign in to comment.