|
@@ -221,15 +221,15 @@
|
|
|
let params = {
|
|
let params = {
|
|
|
personTel: phone,
|
|
personTel: phone,
|
|
|
}
|
|
}
|
|
|
- let res = await this.$api.shop.list(params)
|
|
|
|
|
- if (this.$isEmpty(res.data.records)) {
|
|
|
|
|
|
|
+ let res = await this.$api.shop.myShop(params)
|
|
|
|
|
+ if (this.$isEmpty(res.data)) {
|
|
|
this.$u.vuex('vuex_shopStatus', false)
|
|
this.$u.vuex('vuex_shopStatus', false)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (this.$cache.get('defaultValue')) {
|
|
if (this.$cache.get('defaultValue')) {
|
|
|
this.defaultValue = this.$cache.get('defaultValue')
|
|
this.defaultValue = this.$cache.get('defaultValue')
|
|
|
}
|
|
}
|
|
|
- this.shopList = res.data.records
|
|
|
|
|
|
|
+ this.shopList = res.data
|
|
|
let item = this.shopList[this.defaultValue[0]]
|
|
let item = this.shopList[this.defaultValue[0]]
|
|
|
this.shopId = item.id
|
|
this.shopId = item.id
|
|
|
this.shopLable = item.name
|
|
this.shopLable = item.name
|
|
@@ -270,8 +270,22 @@
|
|
|
this.$u.vuex('vuex_merchantNo', item.merchantNo)
|
|
this.$u.vuex('vuex_merchantNo', item.merchantNo)
|
|
|
this.$u.vuex('vuex_mallId', this.mallId)
|
|
this.$u.vuex('vuex_mallId', this.mallId)
|
|
|
this.$u.vuex('vuex_isOpenMember', item.isOpenMember == 1 ? true : false)
|
|
this.$u.vuex('vuex_isOpenMember', item.isOpenMember == 1 ? true : false)
|
|
|
|
|
+
|
|
|
|
|
+ this.cacheToken(item.tokenInfo)
|
|
|
},
|
|
},
|
|
|
- shopConfirm(e) {
|
|
|
|
|
|
|
+ cacheToken(data){
|
|
|
|
|
+ let tokenInfo={
|
|
|
|
|
+ accessToken:data.access_token,
|
|
|
|
|
+ //提前200秒过期
|
|
|
|
|
+ expiresIn:new Date().getTime() + (data.expires_in - 200) * 1000,
|
|
|
|
|
+ refreshToken:data.refresh_token,
|
|
|
|
|
+ tenantId:data.tenant_id,
|
|
|
|
|
+ nickName:data.nick_name
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$cache.put('token',data.access_token)
|
|
|
|
|
+ this.$cache.put("tokenInfo",tokenInfo)
|
|
|
|
|
+ },
|
|
|
|
|
+ async shopConfirm(e) {
|
|
|
this.shopId = e[0].value
|
|
this.shopId = e[0].value
|
|
|
this.shopLable = e[0].label
|
|
this.shopLable = e[0].label
|
|
|
let item = this.shopList.filter((item, index) => {
|
|
let item = this.shopList.filter((item, index) => {
|