feat 头像选项 增加账号显示
This commit is contained in:
parent
d288442ad8
commit
3a239ba326
@ -6,6 +6,7 @@ export default {
|
|||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
state: {
|
||||||
token: null,
|
token: null,
|
||||||
|
id: null,
|
||||||
name: null,
|
name: null,
|
||||||
uname: null,
|
uname: null,
|
||||||
photo: null,
|
photo: null,
|
||||||
@ -19,6 +20,7 @@ export default {
|
|||||||
if (state.token == null) {
|
if (state.token == null) {
|
||||||
if (localStorage.getItem('token') != null) {
|
if (localStorage.getItem('token') != null) {
|
||||||
state.token = localStorage.getItem('token')
|
state.token = localStorage.getItem('token')
|
||||||
|
state.id = localStorage.getItem('id')
|
||||||
state.name = localStorage.getItem('name')
|
state.name = localStorage.getItem('name')
|
||||||
state.uname = localStorage.getItem('uname')
|
state.uname = localStorage.getItem('uname')
|
||||||
state.photo = localStorage.getItem('photo')
|
state.photo = localStorage.getItem('photo')
|
||||||
@ -31,6 +33,7 @@ export default {
|
|||||||
// 清除用户信息
|
// 清除用户信息
|
||||||
destroyUser (state) {
|
destroyUser (state) {
|
||||||
state.token = null
|
state.token = null
|
||||||
|
state.id = null
|
||||||
state.name = null
|
state.name = null
|
||||||
state.uname = null
|
state.uname = null
|
||||||
state.photo = null
|
state.photo = null
|
||||||
@ -57,6 +60,7 @@ export default {
|
|||||||
res => {
|
res => {
|
||||||
if (res.data.status === 1) {
|
if (res.data.status === 1) {
|
||||||
localStorage.setItem('token', res.data.token)
|
localStorage.setItem('token', res.data.token)
|
||||||
|
localStorage.setItem('id', res.data.adminInfo.id)
|
||||||
localStorage.setItem('name', res.data.adminInfo.name)
|
localStorage.setItem('name', res.data.adminInfo.name)
|
||||||
localStorage.setItem('uname', res.data.adminInfo.uname)
|
localStorage.setItem('uname', res.data.adminInfo.uname)
|
||||||
localStorage.setItem('photo', res.data.adminInfo.photo)
|
localStorage.setItem('photo', res.data.adminInfo.photo)
|
||||||
|
@ -20,6 +20,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||||
|
<!-- 账号id显示 -->
|
||||||
|
<el-dropdown-item command="go-adminEdit">
|
||||||
|
<i class="el-icon-user-solid m-r-10"></i>
|
||||||
|
<font class="brandFontColor">{{ this.$store.state.user.name }}</font>
|
||||||
|
</el-dropdown-item>
|
||||||
<!-- 自定义语言设置为右侧弹出 -->
|
<!-- 自定义语言设置为右侧弹出 -->
|
||||||
<el-dropdown-item>
|
<el-dropdown-item>
|
||||||
<el-popover placement="right-start" width="150" trigger="hover" v-model="languagePopoverVisible">
|
<el-popover placement="right-start" width="150" trigger="hover" v-model="languagePopoverVisible">
|
||||||
@ -28,12 +33,15 @@
|
|||||||
<!-- 其他语言可继续添加 -->
|
<!-- 其他语言可继续添加 -->
|
||||||
<!-- <el-radio label="en" class="m-t-10">English</el-radio> -->
|
<!-- <el-radio label="en" class="m-t-10">English</el-radio> -->
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<span slot="reference" class="mainFontColor f-s-16"><i class="iconfont icon-zhongyingwen m-r-10"></i>语言设置</span>
|
<span slot="reference" class="mainFontColor f-s-16"><i
|
||||||
|
class="iconfont icon-zhongyingwen m-r-10"></i>语言设置</span>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|
||||||
<el-dropdown-item class="mainFontColor f-s-16" command="go-setting"><i class="iconfont icon-shezhi m-r-10"></i>设置</el-dropdown-item>
|
<el-dropdown-item class="mainFontColor f-s-16" command="go-setting"><i
|
||||||
<el-dropdown-item class="mainFontColor f-s-16" divided command="logout"><i class="iconfont icon-logout m-r-10"></i>退出登录</el-dropdown-item>
|
class="iconfont icon-shezhi m-r-10"></i>设置</el-dropdown-item>
|
||||||
|
<el-dropdown-item class="mainFontColor f-s-16" divided command="logout"><i
|
||||||
|
class="iconfont icon-logout m-r-10"></i>退出登录</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
@ -264,7 +272,7 @@ export default {
|
|||||||
* @description: 刷新当前页面
|
* @description: 刷新当前页面
|
||||||
*/
|
*/
|
||||||
refreshPage () {
|
refreshPage () {
|
||||||
/* init 数据接口 */
|
/* init 数据接口 */
|
||||||
this.$store.commit('app/setIsMobile') // 获取客户端平台类型
|
this.$store.commit('app/setIsMobile') // 获取客户端平台类型
|
||||||
this.$store.dispatch('fetchPlaneClassList')// 获取机型列表
|
this.$store.dispatch('fetchPlaneClassList')// 获取机型列表
|
||||||
this.$store.dispatch('fetchAirList') // 获取飞机列表
|
this.$store.dispatch('fetchAirList') // 获取飞机列表
|
||||||
@ -278,8 +286,8 @@ export default {
|
|||||||
this.$store.dispatch('fetchMessageList')// 获取管理员公告列表 并弹出公告框
|
this.$store.dispatch('fetchMessageList')// 获取管理员公告列表 并弹出公告框
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 登出
|
* @description: 登出
|
||||||
*/
|
*/
|
||||||
logout () {
|
logout () {
|
||||||
this.$store
|
this.$store
|
||||||
.dispatch('user/destroyUserAsync')
|
.dispatch('user/destroyUserAsync')
|
||||||
@ -290,6 +298,8 @@ export default {
|
|||||||
this.$router.push('/home/set')
|
this.$router.push('/home/set')
|
||||||
} else if (command === 'logout') {
|
} else if (command === 'logout') {
|
||||||
this.logout()
|
this.logout()
|
||||||
|
} else if (command === 'go-adminEdit') {
|
||||||
|
this.$router.push(`/admin/edit/${this.$store.state.user.id}`)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeLang (lang) {
|
changeLang (lang) {
|
||||||
@ -304,12 +314,12 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
paidOrderList: {
|
paidOrderList: {
|
||||||
handler (newVal, oldVal) {
|
handler (newVal, oldVal) {
|
||||||
// 面包条订单图标跳动
|
// 面包条订单图标跳动
|
||||||
if (this.getQuestInterval !== null) {
|
if (this.getQuestInterval !== null) {
|
||||||
clearInterval(this.getQuestInterval)
|
clearInterval(this.getQuestInterval)
|
||||||
}
|
}
|
||||||
if (newVal.length > 0) {
|
if (newVal.length > 0) {
|
||||||
// 订单更新时 订单数大于0 面包条订单图标跳动
|
// 订单更新时 订单数大于0 面包条订单图标跳动
|
||||||
this.getQuestInterval = setInterval(() => {
|
this.getQuestInterval = setInterval(() => {
|
||||||
this.animationTrumpet = !this.animationTrumpet // 面包条订单图标跳动
|
this.animationTrumpet = !this.animationTrumpet // 面包条订单图标跳动
|
||||||
}, 500)
|
}, 500)
|
||||||
@ -323,7 +333,7 @@ export default {
|
|||||||
},
|
},
|
||||||
requestedCount: {
|
requestedCount: {
|
||||||
handler (newVal, oldVal) {
|
handler (newVal, oldVal) {
|
||||||
// 播报退款订单
|
// 播报退款订单
|
||||||
if (newVal.length > oldVal.length) {
|
if (newVal.length > oldVal.length) {
|
||||||
this.speakText('有订单申请退款')
|
this.speakText('有订单申请退款')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user