|
@@ -20,29 +20,36 @@
|
|
|
<view class="iconfont" :class="isShowEye ? iconEyen : iconEyes" @click="passwordClick"></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="login-btn" @click="confirmLogin">登录</view>
|
|
|
- <view class="login-tel">客服热线:0755-22907771</view>
|
|
|
+ <view class="login-btn" @click="confirmLogin">协销登录</view>
|
|
|
+ <!-- 微信用户已绑定供应商账户 -->
|
|
|
+ <error-alert v-if="iseErrorAlert"></error-alert>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { mapMutations } from 'vuex';
|
|
|
+ import errorAlert from '@/components/module/modelAlert/errorAlert.vue'
|
|
|
import authorize from '@/common/config/authorize.js'
|
|
|
import { sellerLogin } from '@/api/seller.js'
|
|
|
import { userInfoLogin } from "@/api/use.js"
|
|
|
var self;
|
|
|
export default{
|
|
|
+ components:{
|
|
|
+ errorAlert
|
|
|
+ },
|
|
|
data() {
|
|
|
return{
|
|
|
nvabarData: { //顶部自定义导航
|
|
|
showCapsule: 0, // 是否显示左上角图标 1表示显示 0表示不显示,
|
|
|
showSearch: 0,
|
|
|
title: '登录', // 导航栏 中间的标题
|
|
|
+ textLeft:true
|
|
|
},
|
|
|
isIphoneX:this.$store.state.isIphoneX,
|
|
|
CustomBar:this.CustomBar,// 顶部导航栏高度
|
|
|
isShowEye:false,
|
|
|
isSeller:false,
|
|
|
+ iseErrorAlert:false,
|
|
|
iconEyes:'icon-yanjing_yincang_o',
|
|
|
iconEyen:'icon-yanjing_xianshi_o',
|
|
|
accountNumber:'', //协销用户登录账号
|
|
@@ -59,19 +66,23 @@
|
|
|
// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
|
|
|
authorize.getUserInfo('weixin').then(wxResponse =>{
|
|
|
userInfoLogin({code:wechatcode,encryptedData:wxResponse.encryptedData,iv:wxResponse.iv}).then(response =>{
|
|
|
- if(response.data.userIdentity !=1){
|
|
|
- this.logout()
|
|
|
- uni.removeStorageSync('sessionid')
|
|
|
- uni.setStorageSync('sessionid','JSESSIONID='+response.data.sessionId)
|
|
|
- this.isSeller= true
|
|
|
+ if(response.code != -6){
|
|
|
+ if(response.data.userIdentity !=1){
|
|
|
+ this.logout()
|
|
|
+ uni.removeStorageSync('sessionid')
|
|
|
+ uni.setStorageSync('sessionid','JSESSIONID='+response.data.sessionId)
|
|
|
+ this.isSeller= true
|
|
|
+ }else{
|
|
|
+ this.login(response.data);
|
|
|
+ this.$store.commit('updateStatus',response.data)
|
|
|
+ uni.setStorageSync('token',response.data.token)
|
|
|
+ uni.removeStorageSync('sessionid')
|
|
|
+ uni.setStorageSync('sessionid','JSESSIONID='+response.data.sessionId)
|
|
|
+ this.$api.navigateTo('/market/pages/index/index')
|
|
|
+ }
|
|
|
}else{
|
|
|
- this.login(response.data);
|
|
|
- this.$store.commit('updateStatus',response.data)
|
|
|
- uni.setStorageSync('token',response.data.token)
|
|
|
- uni.removeStorageSync('sessionid')
|
|
|
- uni.setStorageSync('sessionid','JSESSIONID='+response.data.sessionId)
|
|
|
- // this.$api.navigateTo('/market/pages/user/user')
|
|
|
- this.$api.navigateTo('/market/pages/index/index')
|
|
|
+ this.isSeller= true
|
|
|
+ this.iseErrorAlert= true
|
|
|
}
|
|
|
}).catch(response =>{
|
|
|
this.logout()
|