|
|
@@ -271,17 +271,36 @@ class HomePage extends Component {
|
|
|
operation([
|
|
|
{
|
|
|
text: '家长', onPress: () => {
|
|
|
+ //TODO 拿token
|
|
|
+ fetchGet(API.leaveDetail, {}).then((response) => {
|
|
|
+ if (response.success && !isObjEmpty(response.data)) {
|
|
|
+
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log("error:", JSON.stringify(error));
|
|
|
+ })
|
|
|
+
|
|
|
if (this.props.userInfo.userRole === 2) {
|
|
|
Toast.loading('身份切换中...', 0)
|
|
|
setTimeout(() => {
|
|
|
Toast.success('切换成功!', 1)
|
|
|
switchCurrentUser(1)()
|
|
|
}, 400)
|
|
|
+ } else if (this.props.userInfo.userRole === 1) {
|
|
|
+ Toast.loading('身份切换中...', 0)
|
|
|
+ setTimeout(() => {
|
|
|
+ Toast.success('切换成功!', 1)
|
|
|
+ switchCurrentUser(2)()
|
|
|
+ }, 400)
|
|
|
}
|
|
|
+ switchUser({
|
|
|
+ token: ''
|
|
|
+ })()
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
text: '教师', onPress: () => {
|
|
|
+
|
|
|
if (this.props.userInfo.userRole === 1) {
|
|
|
Toast.loading('身份切换中...', 0)
|
|
|
setTimeout(() => {
|