Skip to content

Commit b6ad89e

Browse files
committed
刷版本号到 v3.1
1 parent 3b44eef commit b6ad89e

File tree

4 files changed

+37
-10
lines changed

4 files changed

+37
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
全新路径显示(原先模式的图床路径会失效,请谨慎升级)
6363
- **2018.10.28 / v3.0**
6464
抛弃数据库,数据json格式保存
65-
- **2018.11.02 to now / v3.0**
65+
- **2018.11.02 to 11.09 / v3.1**
6666

6767
- 重构部分接口逻辑,减少composer依赖
6868
- 添加离线下载(个人版)

app/Console/Commands/OneDrive/Update.php

+34-7
Original file line numberDiff line numberDiff line change
@@ -64,32 +64,41 @@ public function handle()
6464
$this->v_1_1();
6565
$this->v_1_2();
6666
$this->v_2_0();
67-
$result = $this->v_3_0();
67+
$this->v_3_0();
68+
$result = $this->v_3_1();
6869
break;
6970
case 'v1.0':
7071
$this->v_1_1();
7172
$this->v_1_2();
7273
$this->v_2_0();
73-
$result = $this->v_3_0();
74+
$this->v_3_0();
75+
$result = $this->v_3_1();
7476
break;
7577
case 'v1.1':
7678
$this->v_1_2();
7779
$this->v_2_0();
78-
$result = $this->v_3_0();
80+
$this->v_3_0();
81+
$result = $this->v_3_1();
7982
break;
8083
case 'v1.2':
8184
$this->v_2_0();
82-
$result = $this->v_3_0();
85+
$this->v_3_0();
86+
$result = $this->v_3_1();
8387
break;
8488
case 'v2.0':
85-
$result = $this->v_3_0();
89+
$this->v_3_0();
90+
$result = $this->v_3_1();
91+
break;
92+
case 'v3.0':
93+
$result = $this->v_3_1();
8694
break;
8795
default:
8896
$this->v_1_0();
8997
$this->v_1_1();
9098
$this->v_1_2();
9199
$this->v_2_0();
92-
$result = $this->v_3_0();
100+
$this->v_3_0();
101+
$result = $this->v_3_1();
93102
}
94103
Artisan::call('cache:clear');
95104
$this->info($result['status'] . ':' . $result['msg']);
@@ -195,7 +204,25 @@ public function v_3_0()
195204
$this->info('创建完成!');
196205
};
197206
$saved = Tool::saveConfig($data);
198-
return $saved ? $this->returnStatus('更新成功,version=v3.0,请手动执行chmod 777 storage/app/config.json '.PHP_EOL.' 并移除原数据库 rm -f database/database.sqlite') : $this->returnStatus('更新失败,数据迁移失败,请手动迁移', false);
207+
return $saved ? $this->returnStatus('更新成功,version=v3.0,请手动执行chmod 777 storage/app/config.json ' . PHP_EOL . ' 并移除原数据库 rm -f database/database.sqlite') : $this->returnStatus('更新失败,数据迁移失败,请手动迁移', false);
208+
}
209+
210+
/**
211+
* @return array
212+
*/
213+
public function v_3_1()
214+
{
215+
if (!file_exists(storage_path('app/config.json'))) {
216+
$this->warn('未检测到配置文件!正在创建配置文件...');
217+
copy(storage_path('app/example.config.json'), storage_path('app/config.json'));
218+
$this->info('创建完成!');
219+
$config = Tool::config();
220+
} else {
221+
$config = Tool::config();
222+
$config = array_merge($config, ['app_version' => 'v3.1']);
223+
}
224+
$saved = Tool::saveConfig($config);
225+
return $saved ? $this->returnStatus('更新成功,version=v3.1') : $this->returnStatus('更新失败,数据迁移失败,请手动迁移', false);
199226
}
200227

201228
/**

app/Helpers/Constants.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Constants
66
{
7-
const LATEST_VERSION = 'v3.0';
7+
const LATEST_VERSION = 'v3.1';
88

99
const API_VERSION = 'v1.0';
1010
const REST_ENDPOINT = 'https://graph.microsoft.com/';

storage/app/example.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app_version": "v3.0",
2+
"app_version": "v3.1",
33
"client_id": "",
44
"client_secret": "",
55
"redirect_uri": "",

0 commit comments

Comments
 (0)