Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
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
吴迪
gs1
Commits
983cc2d9
Commit
983cc2d9
authored
Dec 21, 2021
by
tang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 个人中心入口
parent
34708a5f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
11 deletions
+40
-11
HeaderBtn.vue
src/components/layout/header/HeaderBtn.vue
+5
-3
topBanner.vue
src/components/layout/topBanner.vue
+31
-6
login.vue
src/views/User/login.vue
+4
-2
No files found.
src/components/layout/header/HeaderBtn.vue
View file @
983cc2d9
<
template
>
<div
class=
"header-btn move-btn"
>
<el-button
v-if=
"!user"
type=
"primary"
style=
"padding: 9px 30px;margin-right: 6px"
size=
"small"
@
click=
"handleToLogin"
>
注册/登录
<el-button
v-if=
"!user"
type=
"primary"
style=
"padding: 9px 30px;margin-right: 6px"
size=
"small"
@
click=
"handleToLogin"
>
注册/登录
</el-button>
<el-button
v-else
type=
"primary"
style=
"padding: 9px 30px;margin-right: 6px"
size=
"small"
@
click=
"handleExit"
>
退出登录
</el-button>
...
...
@@ -32,11 +33,12 @@ export default {
handleToLogin
()
{
this
.
$router
.
push
({
path
:
"/login"
});
},
handleExit
(){
handleExit
()
{
localStorage
.
removeItem
(
'loginInfo'
)
localStorage
.
removeItem
(
'TOKEN'
)
localStorage
.
removeItem
(
'gs-user'
)
this
.
$router
.
push
({
path
:
"/"
});
// this.$router.push({path: "/"})
location
.
href
=
'/'
this
.
user
=
null
}
},
...
...
src/components/layout/topBanner.vue
View file @
983cc2d9
...
...
@@ -15,7 +15,7 @@
</div>
-->
<div
class=
"top-banner-item tb-hover"
>
咨询电话:400-7000-690
</div>
<div
class=
"top-banner-item"
>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<a
class=
"tb-hover"
target=
"_blank"
...
...
@@ -24,28 +24,51 @@
>
</div>
<div
class=
"top-banner-item"
>
<img
src=
"../../assets/image/head/xlwb.png"
alt=
""
/>
<img
src=
"../../assets/image/head/xlwb.png"
alt=
""
/>
<a
class=
"tb-hover"
target=
"_blank"
href=
"https://weibo.com/gs1cn"
>
官方微博
</a
>
</div>
<div
class=
"top-banner-item tb-hover"
@
click=
"hand
el
Search"
>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
<div
class=
"top-banner-item tb-hover"
@
click=
"hand
le
Search"
>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
</div>
<span
@
click=
"toAdmin"
style=
"cursor: pointer;margin-left: 4px"
v-if=
"user.username"
>
{{
user
.
username
}}
</span>
</div>
</div>
</
template
>
<
script
>
import
{
mapState
}
from
"vuex"
;
import
{
mapState
}
from
"vuex"
;
export
default
{
name
:
"topBanner"
,
computed
:
{
...
mapState
([
"urls"
]),
},
created
()
{
this
.
user
=
localStorage
.
getItem
(
'loginInfo'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'loginInfo'
))
:
{}
console
.
log
(
this
.
user
)
},
data
()
{
return
{
user
:
{}
}
},
methods
:
{
handelSearch
()
{
toAdmin
()
{
if
(
this
.
user
.
userType
===
3
&&
this
.
user
.
levels
===
null
)
{
this
.
$router
.
push
({
path
:
'/MyManage/UnVerify/index'
})
}
else
if
(
this
.
user
.
userType
===
2
)
{
this
.
$router
.
push
({
path
:
'/MyManage/SystemMember/index'
})
}
else
if
(
this
.
user
.
levels
===
0
)
{
this
.
$router
.
push
({
path
:
'/MyManage/admin/check'
})
}
else
if
(
this
.
user
.
levels
===
1
)
{
this
.
$router
.
push
({
path
:
'/MyManage/admin/check'
})
}
else
if
(
String
(
this
.
user
.
levels
).
length
===
4
)
{
this
.
$router
.
push
({
path
:
'/MyManage/admin/check'
})
}
},
handleSearch
()
{
this
.
$router
.
push
({
path
:
"/Home/sousuo"
,
});
...
...
@@ -61,6 +84,7 @@ export default {
color
:
#414345
;
}
}
.top-banner
{
height
:
30px
;
width
:
100%
;
...
...
@@ -72,6 +96,7 @@ export default {
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-end
;
.
tb-hover
:
hover
{
cursor
:
pointer
;
color
:
#0e2c6b
;
...
...
src/views/User/login.vue
View file @
983cc2d9
...
...
@@ -114,15 +114,17 @@ export default {
this
.
$api
.
user
.
login
({
...
this
.
userForm
,
uuid
:
this
.
uuid
}).
then
(
res
=>
{
}).
then
(
async
res
=>
{
console
.
log
(
res
,
!
res
.
success
)
if
(
!
res
.
success
)
{
this
.
userLoginError
=
res
.
returnMsg
||
'用户名或密码不正确!'
this
.
showUserLoginError
=
true
;
this
.
getCaptcha
();
}
else
{
localStorage
.
setItem
(
'loginInfo'
,
JSON
.
stringify
(
res
.
data
))
localStorage
.
setItem
(
'TOKEN'
,
res
.
data
.
token
)
const
memberInfo
=
await
this
.
$api
.
myManage
.
memberInfo
({
id
:
res
.
data
.
id
})
console
.
log
(
memberInfo
)
localStorage
.
setItem
(
'loginInfo'
,
JSON
.
stringify
({...
res
.
data
,
...
memberInfo
.
data
}))
if
(
res
.
data
.
userType
===
3
&&
res
.
data
.
levels
===
null
)
{
localStorage
.
setItem
(
'gs-user'
,
JSON
.
stringify
({
type
:
'unVerify'
}))
this
.
$router
.
push
({
path
:
'/MyManage/UnVerify/index'
})
...
...
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