|
|
@@ -1,5 +1,5 @@
|
|
|
import { mapGetters } from 'vuex'
|
|
|
-import { pageTo, getCheckLogin } from '@/utils/util.js'
|
|
|
+import { pageTo, getCheckLogin, isLogin } from '@/utils/util.js'
|
|
|
import { getUser } from '@/utils/auth'
|
|
|
import constant from '@/constant'
|
|
|
export default {
|
|
|
@@ -30,13 +30,29 @@ export default {
|
|
|
uni.setStorageSync('currentQuery', option)
|
|
|
// 登录
|
|
|
if (constant.source == 'business' || constant.source == 'mobile') {
|
|
|
- getCheckLogin().then(res => {
|
|
|
- if (constant.source == 'business') {
|
|
|
- if (res) {
|
|
|
- getUser()
|
|
|
- }
|
|
|
+ if (isLogin()) {
|
|
|
+ if (this.init) {
|
|
|
+ this.init()
|
|
|
+ // console.log('init', this.init)
|
|
|
}
|
|
|
- })
|
|
|
+ } else {
|
|
|
+ getCheckLogin().then(res => {
|
|
|
+ if (constant.source == 'business') {
|
|
|
+ if (res) {
|
|
|
+ getUser()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (constant.source == 'official') {
|
|
|
+ this.init()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ if (this.mInit) {
|
|
|
+ this.mInit()
|
|
|
+ // console.log('init', this.mInit)
|
|
|
}
|
|
|
}
|
|
|
}
|