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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
16 deletions
+45
-16
HeaderBtn.vue
src/components/layout/header/HeaderBtn.vue
+5
-3
topBanner.vue
src/components/layout/topBanner.vue
+36
-11
login.vue
src/views/User/login.vue
+4
-2
No files found.
src/components/layout/header/HeaderBtn.vue
View file @
983cc2d9
<
template
>
<
template
>
<div
class=
"header-btn move-btn"
>
<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>
<el-button
v-else
type=
"primary"
style=
"padding: 9px 30px;margin-right: 6px"
size=
"small"
@
click=
"handleExit"
>
退出登录
<el-button
v-else
type=
"primary"
style=
"padding: 9px 30px;margin-right: 6px"
size=
"small"
@
click=
"handleExit"
>
退出登录
</el-button>
</el-button>
...
@@ -32,11 +33,12 @@ export default {
...
@@ -32,11 +33,12 @@ export default {
handleToLogin
()
{
handleToLogin
()
{
this
.
$router
.
push
({
path
:
"/login"
});
this
.
$router
.
push
({
path
:
"/login"
});
},
},
handleExit
(){
handleExit
()
{
localStorage
.
removeItem
(
'loginInfo'
)
localStorage
.
removeItem
(
'loginInfo'
)
localStorage
.
removeItem
(
'TOKEN'
)
localStorage
.
removeItem
(
'TOKEN'
)
localStorage
.
removeItem
(
'gs-user'
)
localStorage
.
removeItem
(
'gs-user'
)
this
.
$router
.
push
({
path
:
"/"
});
// this.$router.push({path: "/"})
location
.
href
=
'/'
this
.
user
=
null
this
.
user
=
null
}
}
},
},
...
...
src/components/layout/topBanner.vue
View file @
983cc2d9
...
@@ -15,37 +15,60 @@
...
@@ -15,37 +15,60 @@
</div>
-->
</div>
-->
<div
class=
"top-banner-item tb-hover"
>
咨询电话:400-7000-690
</div>
<div
class=
"top-banner-item tb-hover"
>
咨询电话:400-7000-690
</div>
<div
class=
"top-banner-item"
>
<div
class=
"top-banner-item"
>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<img
src=
"../../assets/image/head/wx.png"
alt=
""
/>
<a
<a
class=
"tb-hover"
class=
"tb-hover"
target=
"_blank"
target=
"_blank"
:href=
"`$
{urls.ancc}gs1cnweixin.aspx`"
:href=
"`$
{urls.ancc}gs1cnweixin.aspx`"
>官方微信
</a
>官方微信
</a
>
>
</div>
</div>
<div
class=
"top-banner-item"
>
<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
class=
"tb-hover"
target=
"_blank"
href=
"https://weibo.com/gs1cn"
>
官方微博
</a
>
官方微博
</a
>
>
</div>
</div>
<div
class=
"top-banner-item tb-hover"
@
click=
"hand
el
Search"
>
<div
class=
"top-banner-item tb-hover"
@
click=
"hand
le
Search"
>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
<img
src=
"../../assets/image/head/search.png"
alt=
""
/>
</div>
</div>
<span
@
click=
"toAdmin"
style=
"cursor: pointer;margin-left: 4px"
v-if=
"user.username"
>
{{
user
.
username
}}
</span>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
mapState
}
from
"vuex"
;
import
{
mapState
}
from
"vuex"
;
export
default
{
export
default
{
name
:
"topBanner"
,
name
:
"topBanner"
,
computed
:
{
computed
:
{
...
mapState
([
"urls"
]),
...
mapState
([
"urls"
]),
},
},
created
()
{
this
.
user
=
localStorage
.
getItem
(
'loginInfo'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'loginInfo'
))
:
{}
console
.
log
(
this
.
user
)
},
data
()
{
return
{
user
:
{}
}
},
methods
:
{
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
({
this
.
$router
.
push
({
path
:
"/Home/sousuo"
,
path
:
"/Home/sousuo"
,
});
});
...
@@ -61,6 +84,7 @@ export default {
...
@@ -61,6 +84,7 @@ export default {
color
:
#414345
;
color
:
#414345
;
}
}
}
}
.top-banner
{
.top-banner
{
height
:
30px
;
height
:
30px
;
width
:
100%
;
width
:
100%
;
...
@@ -72,6 +96,7 @@ export default {
...
@@ -72,6 +96,7 @@ export default {
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
flex-end
;
justify-content
:
flex-end
;
.
tb-hover
:
hover
{
.
tb-hover
:
hover
{
cursor
:
pointer
;
cursor
:
pointer
;
color
:
#0e2c6b
;
color
:
#0e2c6b
;
...
...
src/views/User/login.vue
View file @
983cc2d9
...
@@ -114,15 +114,17 @@ export default {
...
@@ -114,15 +114,17 @@ export default {
this
.
$api
.
user
.
login
({
this
.
$api
.
user
.
login
({
...
this
.
userForm
,
...
this
.
userForm
,
uuid
:
this
.
uuid
uuid
:
this
.
uuid
}).
then
(
res
=>
{
}).
then
(
async
res
=>
{
console
.
log
(
res
,
!
res
.
success
)
console
.
log
(
res
,
!
res
.
success
)
if
(
!
res
.
success
)
{
if
(
!
res
.
success
)
{
this
.
userLoginError
=
res
.
returnMsg
||
'用户名或密码不正确!'
this
.
userLoginError
=
res
.
returnMsg
||
'用户名或密码不正确!'
this
.
showUserLoginError
=
true
;
this
.
showUserLoginError
=
true
;
this
.
getCaptcha
();
this
.
getCaptcha
();
}
else
{
}
else
{
localStorage
.
setItem
(
'loginInfo'
,
JSON
.
stringify
(
res
.
data
))
localStorage
.
setItem
(
'TOKEN'
,
res
.
data
.
token
)
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
)
{
if
(
res
.
data
.
userType
===
3
&&
res
.
data
.
levels
===
null
)
{
localStorage
.
setItem
(
'gs-user'
,
JSON
.
stringify
({
type
:
'unVerify'
}))
localStorage
.
setItem
(
'gs-user'
,
JSON
.
stringify
({
type
:
'unVerify'
}))
this
.
$router
.
push
({
path
:
'/MyManage/UnVerify/index'
})
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