|
@@ -1,10 +1,10 @@
|
|
<template>
|
|
<template>
|
|
- <div class="header-nav">
|
|
|
|
|
|
+ <div class="header-nav" v-loading="loading">
|
|
<div class="container">
|
|
<div class="container">
|
|
<div class="nav-location pull-left">
|
|
<div class="nav-location pull-left">
|
|
<i class="el-icon-location-outline" style="margin-right: 5px"></i>
|
|
<i class="el-icon-location-outline" style="margin-right: 5px"></i>
|
|
- <span style="line-height: 34px" v-if="!city && city != ''">{{city}}</span>
|
|
|
|
- <span style="line-height: 34px" v-else>暂无</span>
|
|
|
|
|
|
+ <span style="line-height: 34px" v-if="!city || city == ''">暂无</span>
|
|
|
|
+ <span style="line-height: 34px" v-else>{{city}}</span>
|
|
</div>
|
|
</div>
|
|
<div class="nav-list pull-right">
|
|
<div class="nav-list pull-right">
|
|
<ul>
|
|
<ul>
|
|
@@ -92,6 +92,7 @@
|
|
data(){
|
|
data(){
|
|
return {
|
|
return {
|
|
user: {},
|
|
user: {},
|
|
|
|
+ loading: false,
|
|
fullScreenLoading: true,
|
|
fullScreenLoading: true,
|
|
loginUrl: process.env.LOGIN_URL,
|
|
loginUrl: process.env.LOGIN_URL,
|
|
registerUrl: process.env.REGISTER_URL,
|
|
registerUrl: process.env.REGISTER_URL,
|
|
@@ -125,13 +126,23 @@
|
|
},
|
|
},
|
|
getAddress(){
|
|
getAddress(){
|
|
Http.get(Apis.USER.GET_ADDRESS).then((res) => {
|
|
Http.get(Apis.USER.GET_ADDRESS).then((res) => {
|
|
|
|
+ console.log(res);
|
|
this.city = res.city
|
|
this.city = res.city
|
|
|
|
+ console.log(this.city);
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
this.hideLoading()
|
|
this.hideLoading()
|
|
notify('error', '获取定位失败:' + error.data)
|
|
notify('error', '获取定位失败:' + error.data)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ showLoading() {
|
|
|
|
+ this.loading = true
|
|
|
|
+ },
|
|
|
|
+ hideLoading() {
|
|
|
|
+ this.loading = false
|
|
|
|
+ },
|
|
setUserInfo () {
|
|
setUserInfo () {
|
|
|
|
+ this.showLoading();
|
|
if (storageGet('user') == null) {
|
|
if (storageGet('user') == null) {
|
|
storageSave('rolesPermissions', {
|
|
storageSave('rolesPermissions', {
|
|
'isRegionManager': false,
|
|
'isRegionManager': false,
|
|
@@ -149,23 +160,25 @@
|
|
// this.fullScreenLoading = false
|
|
// this.fullScreenLoading = false
|
|
|
|
|
|
getCurrentUser().then((res) => {
|
|
getCurrentUser().then((res) => {
|
|
- // console.log(res)
|
|
|
|
storageSave('user', res)
|
|
storageSave('user', res)
|
|
this.user = res
|
|
this.user = res
|
|
this.rolesPermissions = getRolesPermissions(res.roleList)
|
|
this.rolesPermissions = getRolesPermissions(res.roleList)
|
|
storageSave('rolesPermissions', getRolesPermissions(res.roleList))
|
|
storageSave('rolesPermissions', getRolesPermissions(res.roleList))
|
|
console.log('用户信息加载成功')
|
|
console.log('用户信息加载成功')
|
|
this.isLogin = true
|
|
this.isLogin = true
|
|
- this.fullScreenLoading = false
|
|
|
|
|
|
+ // this.fullScreenLoading = false
|
|
|
|
+ this.hideLoading();
|
|
}).catch((error) => {
|
|
}).catch((error) => {
|
|
console.log('用户信息加载失败')
|
|
console.log('用户信息加载失败')
|
|
- this.fullScreenLoading = false
|
|
|
|
|
|
+ // this.fullScreenLoading = false
|
|
|
|
+ this.hideLoading();
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
this.user = storageGet('user')
|
|
this.user = storageGet('user')
|
|
- this.fullScreenLoading = false
|
|
|
|
|
|
+ // this.fullScreenLoading = false
|
|
this.isLogin = true
|
|
this.isLogin = true
|
|
}
|
|
}
|
|
|
|
+ this.hideLoading();
|
|
},
|
|
},
|
|
getCurrentUserSuccess (res) {
|
|
getCurrentUserSuccess (res) {
|
|
// console.log(res)
|
|
// console.log(res)
|
|
@@ -189,12 +202,12 @@
|
|
})
|
|
})
|
|
|
|
|
|
},
|
|
},
|
|
- showLoading () {
|
|
|
|
- this.fullScreenLoading = true
|
|
|
|
- },
|
|
|
|
- hideLoading () {
|
|
|
|
- this.fullScreenLoading = false
|
|
|
|
- },
|
|
|
|
|
|
+ // showLoading () {
|
|
|
|
+ // this.fullScreenLoading = true
|
|
|
|
+ // },
|
|
|
|
+ // hideLoading () {
|
|
|
|
+ // this.fullScreenLoading = false
|
|
|
|
+ // },
|
|
handleClickAuthReject () {
|
|
handleClickAuthReject () {
|
|
if (this.user.userVO.authType == 'agency') {
|
|
if (this.user.userVO.authType == 'agency') {
|
|
this.$router.push({
|
|
this.$router.push({
|
|
@@ -357,12 +370,11 @@
|
|
})
|
|
})
|
|
},
|
|
},
|
|
beforeMount () {
|
|
beforeMount () {
|
|
|
|
+ this.getAddress();
|
|
this.setUserInfo()
|
|
this.setUserInfo()
|
|
// if (storageGet('user' != null)){
|
|
// if (storageGet('user' != null)){
|
|
// this.isLogin = true
|
|
// this.isLogin = true
|
|
// }
|
|
// }
|
|
- this.getAddress();
|
|
|
|
- console.log(this.isLogin)
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|