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
af19a29c
Commit
af19a29c
authored
Jan 09, 2019
by
agping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
a835ac3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
51 deletions
+0
-51
public.js
public/resource/js/public.js
+0
-51
No files found.
public/resource/js/public.js
View file @
af19a29c
...
...
@@ -35,57 +35,6 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
//是否有导航栏的标识
var
haveMenu
=
!~
location
.
href
.
indexOf
(
'/userModalList'
);
haveMenu
&&
menu_bar
(
function
(){
//回调部分
//记录tab的点击状态,对应的标签内容展开,并高亮显示
var
_hash
=
location
.
pathname
.
replace
(
'/admin.php/'
,
'/'
);
var
_tempObj
=
$
(
'[href="'
+
_hash
+
'"]'
);
_tempObj
.
addClass
(
'active-a'
).
siblings
().
removeClass
(
'active-a'
);
_tempObj
.
closest
(
'.dropdown-menu'
).
prev
().
attr
(
'aria-expanded'
,
true
).
parents
().
addClass
(
'open'
).
siblings
().
removeClass
(
'open'
);
});
function
menu_bar
(
fn
)
{
var
user_info_obj
=
JSON
.
parse
(
decodeURIComponent
(
localStorage
.
getItem
(
'pcUserInfo'
)));
//读取缓存
console
.
log
(
user_info_obj
);
//登录时间无效 直接跳转登录页面
if
(
!
user_info_obj
){
alert
(
'登录失效,请您重新登录'
);
window
.
location
.
href
=
"login.html"
;
}
$
(
"#menu_bar"
).
append
(
template
);
if
(
user_info_obj
)
{
console
.
log
(
document
.
getElementById
(
'menu_tpl'
))
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
// alert(user_info_obj['name'])
// $ ("#dropdownMenu1").append(user_info_obj['name']);
$
(
"#menu_bar"
).
html
(
doTtmpl
(
user_info_obj
[
'menu'
]));
//回调
fn
&&
fn
();
}
else
{
$
.
ajax
({
url
:
'/index/getMenu'
,
type
:
'POST'
,
async
:
true
,
data
:
""
,
dataType
:
'json'
,
success
:
function
(
data
)
{
var
temp
=
document
.
getElementById
(
'menu_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#menu_bar"
).
html
(
doTtmpl
(
data
.
data
.
menu
));
//回调
fn
&&
fn
();
}
});
}
}
$
(
"#logout"
).
click
(
function
()
{
localStorage
.
removeItem
(
'pcUserInfo'
);
});
...
...
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