Commit 1fe28707 authored by 罗超's avatar 罗超

调整权限判定

parent aaad6eaa
......@@ -58,6 +58,16 @@
});
data.erpUsers=uni.getStorageSync('ErpStus')
data.currentErpUser=uni.getStorageSync('erpUserInfo')
let userInfo=uni.getStorageSync('userInfo')
if(!data.currentErpUser){
data.erpUsers.forEach(x=>{
if(x.ClassInAccount==userInfo.Account){
data.currentErpUser=x
uni.setStorageSync('erpUserInfo',x)
}
})
}
let methods = {
closeChangeUserHandler(){
console.log('in....')
......
......@@ -138,19 +138,27 @@
},
setAccountsLogin(Accounts){
getLoginAccounts({Accounts}).then(r=>{
let erpStus=uni.getStorageSync('ErpStus')
if(r.Data && r.Data.length>0){
let erpStus=uni.getStorageSync('ErpStus')
erpStus.forEach(x=>{
if(x.ClassInAccount==r.Data[0].Account){
uni.setStorageSync('erpUserInfo',x)
}
})
if(erpStus){
erpStus.forEach(x=>{
if(x.ClassInAccount==r.Data[0].Account){
uni.setStorageSync('erpUserInfo',x)
}
})
}
uni.setStorageSync("userInfo", r.Data[0]);
uni.setStorageSync("users",r.Data)
console.log(r.Data && r.Data.length>0)
uni.reLaunch({
url:'/pages/index/index'
})
}else if(erpStus){
uni.setStorageSync('erpUserInfo',x[0])
uni.reLaunch({
url:'/pages/index/index'
})
}
}).catch(e=>{
console.log(e)
......
......@@ -177,13 +177,17 @@
}
}, 1000);
}else{
data.loading=false
Toast.fail("账号类型选择错误,请根据真实身份选择")
}
}else{
data.loading=false
methods.getErpStudentBindInfo({Account:msg.Account})
//console.log('1111')
}
}).catch(e=>{
console.log(e)
data.loading=false
})
},
......@@ -196,15 +200,41 @@
WImage:userWxInfo.userInfo.avatarUrl,
UnionId:data.userAuth.unionid
}).then(r=>{
console.log(r)
if(r.Data && r.Data.length>0){
uni.setStorageSync("ErpStus",r.Data)
let flag=false
r.Data.forEach(x=>{
if(x.ClassInAccount==u.Account){
flag=true
uni.setStorageSync('erpUserInfo',x)
}
})
if(!flag){
r.Data.forEach(x=>{
if(x.RealPhone==u.Account){
flag=true
uni.setStorageSync('erpUserInfo',x)
}
})
}
if(flag || uni.getStorageSync("userInfo")){
uni.setStorageSync("ErpStus",r.Data)
methods.jumpPage()
}else{
uni.showToast({
title: '账号错误,未匹配到学员信息',
duration: 2000,
icon: "none"
});
}
}else if(uni.getStorageSync("userInfo")){
methods.jumpPage()
}else{
uni.showToast({
title: '账号错误,未匹配到学员信息',
duration: 2000,
icon: "none"
});
}
})
}
......
......@@ -66,17 +66,18 @@
</view>
</view>
<van-toast id="van-toast" />
<view class="btnfixed">
<!-- <view class="btnfixed">
<image @click="goappointment"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/yuyuebtn.png"
mode="widthFix"></image>
</view>
</view> -->
<tabbar active-name='classtime'></tabbar>
</view>
</template>
<script>
import Item from "./timeTable-item.vue";
import tabbar from '../../components/tabbar.vue'
import {
ref,
reactive,
......@@ -102,7 +103,8 @@
name: "",
props: {},
components: {
Item
Item,
tabbar
},
setup(props) {
const Toast = inject('$toast')
......
......@@ -43,19 +43,27 @@ let request = (param) => {
resolve(res.data)
}
}else{
uni.showToast({
title: res.data.Message,
duration: 2000,
icon: "none",
success() {
if(res.data.Code === 0){
resolve(res.data)
}else{
reject()
let shields=['手机号码登录失败、跳转至账号登录']
if(shields.indexOf(res.data.Message)==-1){
uni.showToast({
title: res.data.Message,
duration: 2000,
icon: "none",
success() {
if(res.data.Code === 0){
resolve(res.data)
}else{
reject()
}
}
});
}else{
if(res.data.Code === 0){
resolve(res.data)
}else{
reject()
}
});
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment