|
@@ -27,61 +27,33 @@ export default {
|
|
|
if (option.account) {
|
|
if (option.account) {
|
|
|
uni.setStorageSync('account', option.account)
|
|
uni.setStorageSync('account', option.account)
|
|
|
}
|
|
}
|
|
|
- if (constant.source == 'mobile') {
|
|
|
|
|
- if (option.shopId) {
|
|
|
|
|
- uni.setStorageSync('shopId', option.shopId)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
uni.setStorageSync('currentQuery', JSON.stringify(option))
|
|
uni.setStorageSync('currentQuery', JSON.stringify(option))
|
|
|
- // 登录
|
|
|
|
|
- if (constant.source == 'store' || constant.source == 'mobile') {
|
|
|
|
|
- if (isLogin()) {
|
|
|
|
|
- // #ifdef H5
|
|
|
|
|
- if (this.init) {
|
|
|
|
|
- if (constant.source == 'store') {
|
|
|
|
|
- getUser()
|
|
|
|
|
- }
|
|
|
|
|
- this.init()
|
|
|
|
|
- // console.log('init', this.init)
|
|
|
|
|
- }
|
|
|
|
|
- // #endif
|
|
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
|
- wxLoginFn().then(res => {
|
|
|
|
|
- if (this.init) {
|
|
|
|
|
- if (constant.source == 'store') {
|
|
|
|
|
- getUser()
|
|
|
|
|
- }
|
|
|
|
|
- this.init()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- // #endif
|
|
|
|
|
- } else {
|
|
|
|
|
- // #ifdef H5
|
|
|
|
|
- getCheckLogin().then(res => {
|
|
|
|
|
- if (constant.source == 'store') {
|
|
|
|
|
- if (res) {
|
|
|
|
|
- getUser()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- // #endif
|
|
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
|
- wxLoginFn().then(res => {
|
|
|
|
|
- if (this.init) {
|
|
|
|
|
- if (constant.source == 'store') {
|
|
|
|
|
- getUser()
|
|
|
|
|
- }
|
|
|
|
|
- this.init()
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- // #endif
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (constant.source == 'official') {
|
|
|
|
|
- if (this.init) {
|
|
|
|
|
- this.init()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (isLogin() == false) {
|
|
|
|
|
+ // if (this.init) {
|
|
|
|
|
+ // if (constant.source == 'store') {
|
|
|
|
|
+ // getUser()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.init()
|
|
|
|
|
+ // }
|
|
|
|
|
+ wxLoginFn().then(res => {
|
|
|
|
|
+ getUser()
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
+ // getCheckLogin().then(res => {
|
|
|
|
|
+ // if (constant.source == 'store') {
|
|
|
|
|
+ // if (res) {
|
|
|
|
|
+ // getUser()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // wxLoginFn().then(res => {
|
|
|
|
|
+ // if (this.init) {
|
|
|
|
|
+ // if (constant.source == 'store') {
|
|
|
|
|
+ // getUser()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // this.init()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
if (this.mInit) {
|
|
if (this.mInit) {
|