sj13467204146 2019-07-11 11:32 采纳率: 0%
浏览 505

Angular的ng-show做一个简单的权限控制,方法可执行,但是页面没有展示效果,求解~

<li class="treeview" ng-model="agriForm" ng-show="agriForm.show.true">
                        <a href="#">
                            <i class="fa fa-folder"></i> 
                            <span>农事填报</span>
                            <span class="pull-right-container">
                                <i class="fa fa-angle-left pull-right"></i>
                            </span>
                        </a>
                        <ul class="treeview-menu">
                            <li id="typyId">
                                <a href="type_manage.html" target="iframe" ><!--ng-show="type.show"-->
                                    <i class="fa fa-circle-o"></i> 种类维护
                                </a>
                            </li>
                            <li id="varietiesId">
                                <a href="varieties_manage.html" target="iframe" ><!--ng-show="varieties.show"-->
                                    <i class="fa fa-circle-o"></i> 品种信息
                                </a>
                            </li>
                            <li id="adminId">
                                <a href="main_manage.html" target="iframe" ><!--ng-show="main.show"-->
                                    <i class="fa fa-circle-o"></i> 产收成录入
                                </a>
                            </li>
                        </ul>                        
                    </li>

$scope.userInfo={};
    $scope.login=function (username,password,check) {
        if(username && password && check) {
            userService.login(username, password,check).success(
                function (response) {
                    if (response.flag) {
                        $scope.userInfo=response.data;
                        $scope.name=$scope.userInfo.name;
                        var roleName = $scope.userInfo.roleName;
                        if(roleName=='农户'){
                            location.href = "admin/index2.html";
                        }
                        if(roleName=='区管理员'){
                            location.href = "admin/index3.html";
                        }
                        if(roleName=='管理员'){
                            $scope.agriForm={
                                show:true
                            };
                            location.href = "admin/index.html";
                        }
                    } else {
                        alert(response.errorMsg);
                    }
                }
            )
        }else{
            alert("请输入用户名和密码");
        }
    }
  • 写回答

1条回答 默认 最新

  • zqbnqsdsmd 2019-07-11 11:59
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog