Skip to content

Commit 2acff19

Browse files
committed
更新3.1.8
1 parent d647d1c commit 2acff19

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/Controller.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ public function getConfig(){
8686
if ($this->tp_version === 5){
8787
Lang::setLangCookieVar($params['lang']);
8888
}else{
89-
Lang::setLangSet($params['lang']);
9089
\think\facade\App::loadLangPack($params['lang']);
90+
Lang::setLangSet($params['lang']);
9191
}
9292

9393
}
@@ -150,7 +150,8 @@ public function getApidoc(){
150150
if ($this->tp_version === 5){
151151
Lang::setLangCookieVar($lang);
152152
}else{
153-
\think\facade\App::loadLangPack($lang);
153+
\think\facade\App::loadLangPack($params['lang']);
154+
Lang::setLangSet($params['lang']);
154155
}
155156

156157
}
@@ -211,8 +212,8 @@ public function getMdMenus(){
211212
if ($this->tp_version === 5){
212213
Lang::setLangCookieVar($params['lang']);
213214
}else{
214-
Lang::setLangSet($params['lang']);
215215
\think\facade\App::loadLangPack($params['lang']);
216+
Lang::setLangSet($params['lang']);
216217
}
217218
}
218219
if (!empty($params['appKey'])){
@@ -241,8 +242,8 @@ public function getMdDetail(){
241242
if ($this->tp_version === 5){
242243
Lang::setLangCookieVar($params['lang']);
243244
}else{
244-
Lang::setLangSet($params['lang']);
245245
\think\facade\App::loadLangPack($params['lang']);
246+
Lang::setLangSet($params['lang']);
246247
}
247248
}
248249
try {

src/generator/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ protected function createTable($table){
294294
if (!empty($item['incremental']) && !empty($item['main_key'])){
295295
$table_field.=" AUTO_INCREMENT";
296296
}
297-
if (!empty($item['default'])){
297+
if (!empty($item['default']) || $item['default']=="0"){
298298
$table_field.=" DEFAULT '".$item['default']."'";
299299
}else if (!empty($item['main_key']) && !$item['not_null']){
300300
$table_field.=" DEFAULT NULL";

src/parseApi/ParseAnnotation.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ public function __construct()
5252
{
5353
$this->reader = new AnnotationReader();
5454
$this->config = Config::get('apidoc')?Config::get('apidoc'):Config::get('apidoc.');
55+
if (!empty($this->config['ignored_annitation'])){
56+
foreach ($this->config['ignored_annitation'] as $item) {
57+
AnnotationReader::addGlobalIgnoredName($item);
58+
}
59+
}
5560
$this->controller_layer = Config::get('route.controller_layer',"controller");
5661
}
5762

0 commit comments

Comments
 (0)