切换导航条
此项目
正在载入...
登录
何书鹏
/
anttest
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
6 years ago
提交
a85db2323a04eccad9c8f0502f46c889a8468c42
1 个父辈
b927b544
新增toggle开关disable参数
新增buttons数组按钮confirm支持function 修复CRUD生成多级模型时事务失效的BUG 修复token为空不验证的BUG
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
22 行增加
和
13 行删除
application/admin/command/Addon.php
application/admin/command/Crud.php
application/admin/command/Crud/stubs/model.stub
application/admin/command/Menu.php
application/admin/controller/Index.php
application/index/controller/User.php
public/assets/js/require-backend.min.js
public/assets/js/require-table.js
application/admin/command/Addon.php
查看文件 @
a85db23
...
...
@@ -120,7 +120,7 @@ class Addon extends Command
$output
->
warning
(
$v
);
}
$output
->
info
(
"Are you sure you want to "
.
(
$action
==
'enable'
?
'override'
:
'delete'
)
.
" all those files? Type 'yes' to continue: "
);
$line
=
fgets
(
STDIN
);
$line
=
fgets
(
defined
(
'STDIN'
)
?
STDIN
:
fopen
(
'php://stdin'
,
'r'
)
);
if
(
trim
(
$line
)
!=
'yes'
)
{
throw
new
Exception
(
"Operation is aborted!"
);
}
...
...
@@ -156,7 +156,7 @@ class Addon extends Command
$output
->
warning
(
$v
);
}
$output
->
info
(
"Are you sure you want to override all those files? Type 'yes' to continue: "
);
$line
=
fgets
(
STDIN
);
$line
=
fgets
(
defined
(
'STDIN'
)
?
STDIN
:
fopen
(
'php://stdin'
,
'r'
)
);
if
(
trim
(
$line
)
!=
'yes'
)
{
throw
new
Exception
(
"Operation is aborted!"
);
}
...
...
@@ -186,7 +186,7 @@ class Addon extends Command
$output
->
warning
(
$v
);
}
$output
->
info
(
"Are you sure you want to delete all those files? Type 'yes' to continue: "
);
$line
=
fgets
(
STDIN
);
$line
=
fgets
(
defined
(
'STDIN'
)
?
STDIN
:
fopen
(
'php://stdin'
,
'r'
)
);
if
(
trim
(
$line
)
!=
'yes'
)
{
throw
new
Exception
(
"Operation is aborted!"
);
}
...
...
application/admin/command/Crud.php
查看文件 @
a85db23
...
...
@@ -840,7 +840,7 @@ class Crud extends Command
}
$data = [
'
databaseConfigName
' => $db
,
'
modelConnection
' => $db == '
database
' ? '' : "protected \$connection = '
{
$db
}
';"
,
'controllerNamespace'
=>
$controllerNamespace
,
'modelNamespace'
=>
$modelNamespace
,
'validateNamespace'
=>
$validateNamespace
,
...
...
application/admin/command/Crud/stubs/model.stub
查看文件 @
a85db23
...
...
@@ -10,8 +10,8 @@ class {%modelName%} extends Model
{%softDelete%}
//数据库
protected $connection = '{%databaseConfigName%}';
{%modelConnection%}
// 表名
protected ${%modelTableType%} = '{%modelTableTypeName%}';
...
...
application/admin/command/Menu.php
查看文件 @
a85db23
...
...
@@ -81,7 +81,7 @@ class Menu extends Command
}
if
(
!
$force
)
{
$output
->
info
(
"Are you sure you want to delete all those menu? Type 'yes' to continue: "
);
$line
=
fgets
(
STDIN
);
$line
=
fgets
(
defined
(
'STDIN'
)
?
STDIN
:
fopen
(
'php://stdin'
,
'r'
)
);
if
(
trim
(
$line
)
!=
'yes'
)
{
throw
new
Exception
(
"Operation is aborted!"
);
}
...
...
application/admin/controller/Index.php
查看文件 @
a85db23
...
...
@@ -67,7 +67,7 @@ class Index extends Backend
$rule
=
[
'username'
=>
'require|length:3,30'
,
'password'
=>
'require|length:3,30'
,
'__token__'
=>
'token'
,
'__token__'
=>
'
require|
token'
,
];
$data
=
[
'username'
=>
$username
,
...
...
application/index/controller/User.php
查看文件 @
a85db23
...
...
@@ -92,7 +92,7 @@ class User extends Frontend
'email'
=>
'require|email'
,
'mobile'
=>
'regex:/^1\d{10}$/'
,
'captcha'
=>
'require|captcha'
,
'__token__'
=>
'token'
,
'__token__'
=>
'
require|
token'
,
];
$msg
=
[
...
...
@@ -152,7 +152,7 @@ class User extends Frontend
$rule
=
[
'account'
=>
'require|length:3,50'
,
'password'
=>
'require|length:6,30'
,
'__token__'
=>
'token'
,
'__token__'
=>
'
require|
token'
,
];
$msg
=
[
...
...
public/assets/js/require-backend.min.js
查看文件 @
a85db23
...
...
@@ -10394,7 +10394,11 @@ define('table',['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstr
var
yes
=
typeof
this
.
yes
!==
'undefined'
?
this
.
yes
:
1
;
var
no
=
typeof
this
.
no
!==
'undefined'
?
this
.
no
:
0
;
var
url
=
typeof
this
.
url
!==
'undefined'
?
this
.
url
:
''
;
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change' data-id='"
var
disable
=
false
;
if
(
typeof
this
.
disable
!==
"undefined"
)
{
disable
=
typeof
this
.
disable
===
"function"
?
this
.
disable
.
call
(
this
,
value
,
row
,
index
)
:
this
.
disable
;
}
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change "
+
(
disable
?
'btn disabled'
:
''
)
+
"' data-id='"
+
row
.
id
+
"' "
+
(
url
?
"data-url='"
+
url
+
"'"
:
""
)
+
" data-params='"
+
this
.
field
+
"="
+
(
value
==
yes
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
},
url
:
function
(
value
,
row
,
index
)
{
...
...
public/assets/js/require-table.js
查看文件 @
a85db23
...
...
@@ -485,7 +485,11 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
var
yes
=
typeof
this
.
yes
!==
'undefined'
?
this
.
yes
:
1
;
var
no
=
typeof
this
.
no
!==
'undefined'
?
this
.
no
:
0
;
var
url
=
typeof
this
.
url
!==
'undefined'
?
this
.
url
:
''
;
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change' data-id='"
var
disable
=
false
;
if
(
typeof
this
.
disable
!==
"undefined"
)
{
disable
=
typeof
this
.
disable
===
"function"
?
this
.
disable
.
call
(
this
,
value
,
row
,
index
)
:
this
.
disable
;
}
return
"<a href='javascript:;' data-toggle='tooltip' title='"
+
__
(
'Click to toggle'
)
+
"' class='btn-change "
+
(
disable
?
'btn disabled'
:
''
)
+
"' data-id='"
+
row
.
id
+
"' "
+
(
url
?
"data-url='"
+
url
+
"'"
:
""
)
+
" data-params='"
+
this
.
field
+
"="
+
(
value
==
yes
?
no
:
yes
)
+
"'><i class='fa fa-toggle-on "
+
(
value
==
yes
?
'text-'
+
color
:
'fa-flip-horizontal text-gray'
)
+
" fa-2x'></i></a>"
;
},
url
:
function
(
value
,
row
,
index
)
{
...
...
@@ -638,7 +642,8 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
text
=
typeof
j
.
text
===
'function'
?
j
.
text
.
call
(
table
,
row
,
j
)
:
j
.
text
?
j
.
text
:
''
;
title
=
typeof
j
.
title
===
'function'
?
j
.
title
.
call
(
table
,
row
,
j
)
:
j
.
title
?
j
.
title
:
text
;
refresh
=
j
.
refresh
?
'data-refresh="'
+
j
.
refresh
+
'"'
:
''
;
confirm
=
j
.
confirm
?
'data-confirm="'
+
j
.
confirm
+
'"'
:
''
;
confirm
=
typeof
j
.
confirm
===
'function'
?
j
.
confirm
.
call
(
table
,
row
,
j
)
:
(
typeof
j
.
confirm
!==
'undefined'
?
j
.
disable
:
false
);
confirm
=
confirm
?
'data-confirm="'
+
confirm
+
'"'
:
''
;
extend
=
j
.
extend
?
j
.
extend
:
''
;
disable
=
typeof
j
.
disable
===
'function'
?
j
.
disable
.
call
(
table
,
row
,
j
)
:
(
typeof
j
.
disable
!==
'undefined'
?
j
.
disable
:
false
);
if
(
disable
)
{
...
...
请
注册
或
登录
后发表评论