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

调整权限判定

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