Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
campSite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨梦雪
campSite
Commits
22dbccad
Commit
22dbccad
authored
Nov 03, 2021
by
孟飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
65c8060b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
12 deletions
+84
-12
src/components/index/Header.vue
src/components/index/Header.vue
+83
-4
src/router/index.js
src/router/index.js
+0
-7
src/views/index/login/Login.vue
src/views/index/login/Login.vue
+1
-1
No files found.
src/components/index/Header.vue
View file @
22dbccad
...
...
@@ -4,7 +4,7 @@
<div
class=
"image"
>
<img
:src=
"system_logo"
alt=
""
/>
</div>
<div
class=
"right"
v-if=
"isLogin"
>
<div
class=
"right"
v-if=
"
!
isLogin"
>
<span
@
mouseenter=
"onMouserEnter(false)"
:class=
"isHover?'':'is-hover'"
@
click=
"toLogin"
>
登录
</span>
<span
@
mouseenter=
"onMouserEnter(true)"
:class=
"isHover?'is-hover':''"
@
click=
"toRegister"
>
注册
</span>
</div>
...
...
@@ -16,10 +16,10 @@
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</div>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"1"
>
<el-dropdown-item
command=
"1"
@
click=
"toCenter"
>
<i
class=
"el-icon-switch-button"
></i>
个人中心
</el-dropdown-item
>
<el-dropdown-item
command=
"
1
"
>
<el-dropdown-item
command=
"
2"
@
click=
"logout
"
>
<i
class=
"el-icon-switch-button"
></i>
退出
</el-dropdown-item
>
</el-dropdown-menu>
...
...
@@ -30,6 +30,8 @@
</
template
>
<
script
>
/* eslint-disable */
import
{
logout
}
from
"
r/index/login
"
;
export
default
{
name
:
"
Header
"
,
data
()
{
...
...
@@ -37,18 +39,66 @@ export default {
isHover
:
true
,
system_logo
:
window
.
localStorage
.
getItem
(
"
system_logo
"
),
isLogin
:
false
,
phone
:
window
.
localStorage
.
getItem
(
"
phone
"
),
};
},
created
()
{},
created
()
{
this
.
isLogin
=
!!
localStorage
.
getItem
(
"
index-token
"
);
},
methods
:
{
toLogin
()
{
let
code
=
localStorage
.
getItem
(
"
index-identity
"
);
this
.
$router
.
push
(
"
/login?code=
"
+
code
);
},
handleCommand
(
command
)
{
if
(
command
==
2
)
{
this
.
logout
();
}
if
(
command
==
1
)
{
this
.
toCenter
();
}
},
toCenter
(){
let
code
=
localStorage
.
getItem
(
"
index-identity
"
);
this
.
$router
.
replace
(
"
/signUp/examInfo?code=
"
+
code
);
},
toRegister
()
{
let
code
=
localStorage
.
getItem
(
"
index-identity
"
);
this
.
$router
.
push
(
"
/register?code=
"
+
code
);
},
async
logout
()
{
const
confirmResult
=
await
this
.
$confirm
(
`确认退出登录?`
,
"
提示
"
,
{
confirmButtonText
:
"
确定
"
,
cancelButtonText
:
"
取消
"
,
closeOnClickModal
:
false
,
type
:
"
warning
"
,
}).
catch
((
err
)
=>
err
);
if
(
confirmResult
!==
"
confirm
"
)
return
this
.
$message
.
info
(
"
您取消了退出
"
);
await
logout
({});
// if (res.code !== 200) return this.$message.error(res.message);
// 清除本地缓存除了大学logo
// window.localStorage.clear();
window
.
localStorage
.
removeItem
(
"
doubt_code
"
);
window
.
localStorage
.
removeItem
(
"
doubt_info
"
);
window
.
localStorage
.
removeItem
(
"
doubt_check
"
);
// window.localStorage.removeItem("index-identity");
window
.
localStorage
.
removeItem
(
"
index-token
"
);
window
.
localStorage
.
removeItem
(
"
phone
"
);
window
.
localStorage
.
removeItem
(
"
camp_name
"
);
window
.
localStorage
.
removeItem
(
"
system_color
"
);
window
.
localStorage
.
removeItem
(
"
has_amount
"
);
window
.
localStorage
.
removeItem
(
"
campsite_id
"
);
window
.
localStorage
.
removeItem
(
"
order_no
"
);
window
.
localStorage
.
removeItem
(
"
campindex_type
"
);
// this.$store.state.token = "";
// 使用编程式导航跳转到登录页面
// this.$router.push({ name: "recruit" });
let
code
=
localStorage
.
getItem
(
"
index-identity
"
);
this
.
$router
.
replace
(
"
/
"
+
code
);
},
onMouserEnter
(
val
){
this
.
isHover
=
val
;
},
...
...
@@ -90,6 +140,35 @@ export default {
}
}
}
.right
{
height
:
80px
;
::v-deep
.el-dropdown
{
height
:
80px
;
.el-dropdown-link
{
height
:
80px
;
display
:
flex
;
flex-flow
:
row
;
align-items
:
center
;
.img_user
{
width
:
34px
;
height
:
34px
;
background-color
:
#d8d8d8
;
border-radius
:
50%
;
}
.phone
{
margin
:
0
10px
0
12px
;
}
}
&
:hover
{
cursor
:
pointer
;
}
}
}
}
}
</
style
>
src/router/index.js
View file @
22dbccad
...
...
@@ -121,13 +121,6 @@ function checkCam(code, cb) {
})
}
function
checkLogin
(){
let
token
=
localStorage
.
getItem
(
"
index-token
"
);
if
(
token
){
}
}
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
let
tokenKey
=
"
index-token
"
,
toLogin
=
"
/login
"
,
...
...
src/views/index/login/Login.vue
View file @
22dbccad
...
...
@@ -172,7 +172,7 @@ export default {
);
// 跳转到报名
let
code
=
localStorage
.
getItem
(
"
index-identity
"
);
this
.
$router
.
push
(
"
/signUp/examInfo?code=
"
+
code
);
this
.
$router
.
replace
(
"
/signUp/examInfo?code=
"
+
code
);
});
});
},
...
...
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