|
@@ -384,7 +384,7 @@
|
|
},
|
|
},
|
|
// #endif
|
|
// #endif
|
|
computed: {
|
|
computed: {
|
|
- ...mapState(['hasLogin', 'userInfo']),
|
|
|
|
|
|
+ ...mapState(['hasLogin', 'userInfo','clientId']),
|
|
// 手机号中间4位加*
|
|
// 手机号中间4位加*
|
|
starUserphone() {
|
|
starUserphone() {
|
|
let reg = /^(\d{3})\d{4}(\d{4})$/;
|
|
let reg = /^(\d{3})\d{4}(\d{4})$/;
|
|
@@ -468,38 +468,39 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
console.log("this.1111")
|
|
console.log("this.1111")
|
|
- uni.getStorage({
|
|
|
|
- key: 'compName1',
|
|
|
|
- success: function (res) {
|
|
|
|
- console.log("this.2222")
|
|
|
|
- console.log(res.data);
|
|
|
|
- if(res.data){
|
|
|
|
- that.compName = res.data
|
|
|
|
|
|
+ // uni.getStorage({
|
|
|
|
+ // key: 'compName1',
|
|
|
|
+ // success: function (res) {
|
|
|
|
+ // console.log("this.2222")
|
|
|
|
+ // console.log(res.data);
|
|
|
|
+ // if(res.data){
|
|
|
|
+ // that.compName = res.data
|
|
|
|
+ // that.haveCompany = true
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // fail() {
|
|
|
|
+
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
|
|
+ that.$api.doRequest('get', '/commonUser/getCompOwn', {
|
|
|
|
+ phone: that.userInfo.phone
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.data.data) {
|
|
|
|
+ that.companyList = res.data.data
|
|
|
|
+ console.log("that.3333")
|
|
|
|
+ console.log(that.companyList)
|
|
|
|
+ if (that.companyList.length > 0) {
|
|
|
|
+ that.compName = that.companyList[0].compName
|
|
|
|
+ console.log("this.compName")
|
|
|
|
+ console.log(that.compName)
|
|
|
|
+ uni.setStorageSync('compName1', that.companyList[0].compName)
|
|
that.haveCompany = true
|
|
that.haveCompany = true
|
|
}
|
|
}
|
|
- },
|
|
|
|
- fail() {
|
|
|
|
- that.$api.doRequest('get', '/commonUser/getCompOwn', {
|
|
|
|
- phone: that.userInfo.phone
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.data.data) {
|
|
|
|
- that.companyList = res.data.data
|
|
|
|
- console.log("that.3333")
|
|
|
|
- console.log(that.companyList)
|
|
|
|
- if (that.companyList.length > 0) {
|
|
|
|
- that.compName = that.companyList[0].compName
|
|
|
|
- console.log("this.compName")
|
|
|
|
- console.log(that.compName)
|
|
|
|
- uni.setStorageSync('compName1', that.companyList[0].compName)
|
|
|
|
- that.haveCompany = true
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- that.haveCompany = false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ else{
|
|
|
|
+ that.haveCompany = false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
|
|
} else {
|
|
} else {
|
|
this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
this.headUrl = "../../static/img/myimg/YongHu@3x.png"
|
|
@@ -517,34 +518,92 @@
|
|
this.isShowAlert = false
|
|
this.isShowAlert = false
|
|
},
|
|
},
|
|
compconfirm(e) {
|
|
compconfirm(e) {
|
|
-
|
|
|
|
- var that = this
|
|
|
|
- this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
|
|
|
|
- mobilePhone: this.userInfo.phone,
|
|
|
|
- companyName: this.companyList[e[0]].compName,
|
|
|
|
- veriCode: "123456",
|
|
|
|
- }).then(res1 => {
|
|
|
|
- if (res1.data.code == 200) {
|
|
|
|
- uni.setStorageSync('pcUserInfo', res1.data.data)
|
|
|
|
- uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
|
|
- that.compName = that.companyList[e[0]].compName
|
|
|
|
- helper.getListByUserId()
|
|
|
|
- that.$api.msg('切换成功')
|
|
|
|
- } else {
|
|
|
|
- that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
|
|
|
|
- mobilePhone: '14444444444',
|
|
|
|
|
|
+ var that=this
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '登录中',
|
|
|
|
+ mask:true
|
|
|
|
+ })
|
|
|
|
+ console.log("clinetId",this.clientId)
|
|
|
|
+ this.$api.doRequest('get','/commonUser/login',{phone:this.userInfo.phone,password:"999999",cid:this.clientId}).then(res => {
|
|
|
|
+ if(res.data.code==200){
|
|
|
|
+ console.log("userInfo",res.data.data)
|
|
|
|
+ uni.setStorageSync('userInfo', res.data.data)
|
|
|
|
+ this.$api.doRequest('post','/commonUser/api/loginQuickly',{
|
|
|
|
+ mobilePhone: this.userInfo.phone,
|
|
companyName: this.companyList[e[0]].compName,
|
|
companyName: this.companyList[e[0]].compName,
|
|
- veriCode: "123456",
|
|
|
|
- }).then(res2 => {
|
|
|
|
- uni.setStorageSync('pcUserInfo', res2.data.data)
|
|
|
|
- uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
|
|
- that.compName = that.companyList[e[0]].compName
|
|
|
|
- helper.getListByUserId()
|
|
|
|
|
|
+ veriCode: "123456",}).then(res1 => {
|
|
|
|
+ console.log("loginQuickly",res)
|
|
|
|
+ if(res1.data.code==200){
|
|
|
|
+ uni.setStorageSync('pcUserInfo', res1.data.data)
|
|
|
|
+ uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
|
|
+ that.compName = that.companyList[e[0]].compName
|
|
|
|
+ helper.getListByUserId()
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ // that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
|
|
|
|
+ // veriCode: "123456",}).then(res2 => {
|
|
|
|
+ // uni.setStorageSync('pcUserInfo', res2.data.data)
|
|
|
|
+ // helper.getListByUserId()
|
|
|
|
+ // })
|
|
|
|
+ }
|
|
|
|
+ that.$store.commit('login', res.data.data)
|
|
|
|
+ var name = 'userInfo';
|
|
|
|
+ var value = res.data.data;
|
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
|
+ name,
|
|
|
|
+ value
|
|
|
|
+ });
|
|
|
|
+ // that.liangxinLogin()
|
|
|
|
+
|
|
|
|
+ // uni.switchTab({
|
|
|
|
+ // url: '/pages/sale/information'
|
|
|
|
+ // });
|
|
|
|
+ uni.hideLoading()
|
|
that.$api.msg('切换成功')
|
|
that.$api.msg('切换成功')
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.data.message,
|
|
|
|
+ icon:'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
}
|
|
}
|
|
-
|
|
|
|
})
|
|
})
|
|
|
|
+ .catch(res => {
|
|
|
|
+ console.log(res);
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // var that = this
|
|
|
|
+ // this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
|
|
|
|
+ // mobilePhone: this.userInfo.phone,
|
|
|
|
+ // companyName: this.companyList[e[0]].compName,
|
|
|
|
+ // veriCode: "123456",
|
|
|
|
+ // }).then(res1 => {
|
|
|
|
+ // if (res1.data.code == 200) {
|
|
|
|
+ // uni.setStorageSync('pcUserInfo', res1.data.data)
|
|
|
|
+ // uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
|
|
+ // that.compName = that.companyList[e[0]].compName
|
|
|
|
+ // helper.getListByUserId()
|
|
|
|
+ // that.$api.msg('切换成功')
|
|
|
|
+ // } else {
|
|
|
|
+ // that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
|
|
|
|
+ // mobilePhone: '14444444444',
|
|
|
|
+ // companyName: this.companyList[e[0]].compName,
|
|
|
|
+ // veriCode: "123456",
|
|
|
|
+ // }).then(res2 => {
|
|
|
|
+ // uni.setStorageSync('pcUserInfo', res2.data.data)
|
|
|
|
+ // uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
|
|
+ // that.compName = that.companyList[e[0]].compName
|
|
|
|
+ // helper.getListByUserId()
|
|
|
|
+ // that.$api.msg('切换成功')
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+ // })
|
|
},
|
|
},
|
|
getRoles: function(role) {
|
|
getRoles: function(role) {
|
|
let _roles = uni.getStorageSync('rolesList')
|
|
let _roles = uni.getStorageSync('rolesList')
|