提交 7deaa249 authored 作者: lihuihui's avatar lihuihui

修改获取信息问题

上级 2625cf93
...@@ -24,7 +24,6 @@ export default class Before { ...@@ -24,7 +24,6 @@ export default class Before {
isLogin () { isLogin () {
if (window.G.UserInfo) return true if (window.G.UserInfo) return true
return cAction.Other.getInfo().then(res => { return cAction.Other.getInfo().then(res => {
console.log(456)
window.G.UserInfo = res window.G.UserInfo = res
return true return true
}).catch(res => { }).catch(res => {
......
...@@ -24,13 +24,14 @@ ...@@ -24,13 +24,14 @@
export default { export default {
components: {}, components: {},
data () { data () {
const isUserInfo = window.G.UserInfo !== undefined
return { return {
name: window.G.UserInfo.student_info.personal_name || window.G.UserInfo.nickname || '你好', name: isUserInfo ? window.G.UserInfo.student_info.personal_name : '' || isUserInfo ? window.G.UserInfo.nickname : '' || '你好',
num: 0 num: 0
} }
}, },
mounted () { mounted () {
this.name = window.G.UserInfo.student_info.personal_name || window.G.UserInfo.nickname || '你好' // this.name = window.G.UserInfo.student_info !== undefined ? window.G.UserInfo.student_info.personal_name : '' || window.G.UserInfo.nickname || '你好'
}, },
methods: { methods: {
goNotify () { goNotify () {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论