Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
dcec105a
Commit
dcec105a
authored
Apr 01, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台按钮权限检测
parent
37fe5f1d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
public.js
public/resource/js/public.js
+22
-3
house_template_tpl.html
public/resource/template/house_template_tpl.html
+3
-1
No files found.
public/resource/js/public.js
View file @
dcec105a
...
@@ -35,7 +35,6 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html'], function (doT, $,t
...
@@ -35,7 +35,6 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html'], function (doT, $,t
if
(
typeof
user_info_obj
===
'string'
)
{
if
(
typeof
user_info_obj
===
'string'
)
{
var
user_info
=
JSON
.
parse
(
user_info_obj
);
var
user_info
=
JSON
.
parse
(
user_info_obj
);
console
.
log
(
user_info
);
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#dropdownMenu1"
).
append
(
user_info
[
'name'
]);
$
(
"#dropdownMenu1"
).
append
(
user_info
[
'name'
]);
...
@@ -86,4 +85,24 @@ String.prototype.stringFormatObj = function(){
...
@@ -86,4 +85,24 @@ String.prototype.stringFormatObj = function(){
formatted
=
formatted
.
replace
(
new
RegExp
(
'
\\
{'
+
i
+
'
\\
}'
,
'gi'
),
arguments
[
0
][
i
]);
formatted
=
formatted
.
replace
(
new
RegExp
(
'
\\
{'
+
i
+
'
\\
}'
,
'gi'
),
arguments
[
0
][
i
]);
};
};
return
formatted
;
return
formatted
;
};
};
\ No newline at end of file
/**
* 权限校验是否显示按钮
*
* @param auth_rule
* @returns {boolean}
*/
function
check_auth
(
auth_rule
)
{
var
user_info_obj
=
localStorage
.
getItem
(
'user_info'
);
//读取缓存
var
user_info
=
JSON
.
parse
(
user_info_obj
);
var
result
=
false
;
$
.
each
(
user_info
.
auth
,
function
(
i
,
val
)
{
if
(
val
[
'name'
]
==
auth_rule
)
{
result
=
true
;
}
});
return
result
;
}
\ No newline at end of file
public/resource/template/house_template_tpl.html
View file @
dcec105a
...
@@ -47,7 +47,9 @@
...
@@ -47,7 +47,9 @@
<
/td
>
<
/td
>
<
td
>
<
td
>
<
a
class
=
"btn1 btn-success "
href
=
"/admin.php/index/houseEdit?id=[%= it[item]['id']%]"
data
-
toggle
=
"modal"
>
编辑
<
/a
>
[
%
if
(
check_auth
(
'index/houseEdit'
))
{
%
]
<
a
class
=
"btn1 btn-success "
href
=
"/admin.php/index/houseEdit?id=[%= it[item]['id']%]"
data
-
toggle
=
"modal"
>
编辑
<
/a
>
[
%
}
%
]
<
a
class
=
"btn1 btn-success is_show"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
推荐至首页
<
/a
>
<
a
class
=
"btn1 btn-success is_show"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
推荐至首页
<
/a
>
<
a
class
=
"btn1 btn-success anch"
data
-
target
=
"#modal-anch"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
设置案场权限人
<
/a
>
<
a
class
=
"btn1 btn-success anch"
data
-
target
=
"#modal-anch"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
设置案场权限人
<
/a
>
<
a
class
=
"btn1 btn-success dujia"
href
=
"#modal-dujia"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
是否独家
<
/a
>
<
a
class
=
"btn1 btn-success dujia"
href
=
"#modal-dujia"
data
-
toggle
=
"modal"
data
-
id
=
'[%= it[item]["id"] %]'
>
是否独家
<
/a
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment