|
|
@@ -164,9 +164,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import Vue from 'vue'
|
|
|
import SearchBox from '@/components/layout/SearchBox'
|
|
|
import { userMixin } from 'assets/js/mixin'
|
|
|
import { getMyInfo } from '@/api/user'
|
|
|
+import VueCookies from "vue-cookies";
|
|
|
|
|
|
export default {
|
|
|
name: 'NavBar',
|
|
|
@@ -179,11 +181,14 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- getMyInfo().then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- this.user = res.data
|
|
|
- }
|
|
|
- })
|
|
|
+ const userdata = Vue.$cookies.get('USERDATA')
|
|
|
+ if (userdata !== null) {
|
|
|
+ getMyInfo().then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ this.user = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
login() {
|