angularjs模块

时间:2016-09-01 06:43:01

标签: angularjs

这是html页面,并且模块是signhtml,为什么我使用此脚本获取注入器错误

  

                经销商登录       

    <!-- EXTERNAL CSS -->
    <link href="styles/open_sans.min.css" rel="stylesheet" type="text/css">
    <link href="styles/style_v2_optimized.css" rel="stylesheet" type="text/css">


    <script>
        window.DOM = {get: function (id) {
                return document.getElementById(id)
            }};
    </script>
</head>
<body class="cp"  id="signin" data-custom-page data-off-canvas-nav data-ng-controller="signinCtrl" data-ng-init="login()">
    <div id="preload_images"></div>

    <input type="hidden" id="goto_uri" value="">
    <input type="hidden" id="goto_app" value="">
    <!-- Do not remove msg_code as it is needed for automated testing - msg_code:[]  -->
    <div id="login-wrapper" class="group has-pw-reset" style="opacity: 1; visibility: visible;">
        <div class="wrapper">
            <div id="notify">
                <noscript>
                &lt;div class="error-notice"&gt;
                &lt;img src="images/notice-error.png" alt="Error" align="left"/&gt;
                JavaScript is disabled in your browser.
                For Webresellers to function properly, you must enable JavaScript.
                If you do not enable JavaScript, certain features in cPanel will not function correctly.
                &lt;/div&gt;
                </noscript>

                <div id="login-status" class="success-notice" ng-show="signedinsuccessfully == true">
                    <div class="content-wrapper">
                        <div id="login-detail">
                            <div id="login-status-icon-container"><span
     

类= “登录状态图标” &GT;                                   登录成功。重定向到面板....                                                                                                                                                                                                                                        登录无效。                                                                                                                                                                                                                                        转销商ID无效。                                                                                                                                                                                                                                        认证.....                                                                                                    

            <div id="content-container">
                <div id="login-container">

                    <div id="login-sub-container">
                        <div id="login-sub-header">
                            <img class="main-logo" src="../images/logo.png" alt="logo">
                        </div>
                        <div id="login-sub">
                            <div id="clickthrough_form" style="visibility:hidden">
                                <form action="javascript:void(0)">
                                    <div class="notices"></div>
                                    <button type="submit" class="clickthrough-cont-btn">Continue</button>
                                </form>
                            </div>
                            <div id="forms">
                                <form novalidate="" id="login_form" ng-submit="login()" style="visibility:">
                                    <div class="input-req-login"><label for="username">Reseller
     

标识                                                                                                                                                                                密码                                                                                                                                                                                                                                                                                  登入                                               

                                        <div class="reset-pw">
                                            <a href="#/account/forgot-password">Forgot your password?</a>
                                        </div>
                                    </div>
                                    <div class="clear" id="push"></div>
                                </form>
                                <!--CLOSE forms -->
                            </div>
                            <!--CLOSE login-sub -->
                        </div>

                   <!--CLOSE wrapper -->
                    </div>
                    <!--CLOSE login-sub-container -->
                </div>
                <!--CLOSE login-container -->
            </div>


        </div>
        <!--Close login-wrapper -->
    </div>

    <script src="../js/angular/angular.min.js" type="text/javascript"></script>
    <!--<script src="../js/angular/1.2.7/angular-resource.min.js" type="text/javascript"></script>-->
    <script src="../js/angular/ui-bootstrap-tpls-0.13.4.min.js" type="text/javascript"></script>
    <script src="../js/angular/ui-bootstrap-tpls-0.14.3.min.js" type="text/javascript"></script>
    <script src="scripts/sgnscript.js" type="text/javascript"></script>
    <script type="text/javascript">var currentip = '56.121.99.78';</script>
    <script type="text/javascript" src="http://l2.io/ip.js?var=currentip"></script>



    <style>
        @media (min-width: 481px) {
            #select_user_form {
                width: px;
            }
        }
    </style>
    <div class="copyright">Copyright©&nbsp;2016 Simpact E-Soft Pvt. Ltd..</div>

</body></html>
var signApp = angular.module('logApp', ['ngRoute', 'ui.bootstrap']);

signApp.controller('signinCtrl',function ($scope, $http, $filter, $uibModal) {
    // sign in panel start
            console.log('widisn');
    $scope.credentials = {username: '', password: ''};  
    $scope.signedinsuccessfully = false;
    $scope.invalidusernamepwd = false;
    $scope.notactive = false;
    $scope.signingin = false;
    $scope.login = function () {
        if (readCookie('loginsignature') != null) {
            if ($scope.signingin == false || $scope.signedinsuccessfully == false) {
                $scope.signedinsuccessfully = false;
                $scope.invalidusernamepwd = false;
                $scope.notactive = false;
                $scope.signingin = true;
                $http.post('logs.php', {fn: 'login', username: $scope.credentials.username, password: $scope.credentials.password, ip: currentip}).then
                        (function (response) {
                            console.log(response);
                            if (response.data.response == 1) {
                                $scope.signingin = false;
                                var jobj = response.data.data;
                                var srv = response.data.services;
                                if (jobj[0].response == 0) {
                                    $scope.invalidusernamepwd = true;
                                    $scope.notactive = false;
                                } else if (jobj[0].response == 2) {
                                    $scope.invalidusernamepwd = false;
                                    $scope.notactive = true;
                                } else {
                                    $scope.signedinsuccessfully = true;
                                    $scope.credentials.username = '';
                                    $scope.credentials.password = '';
                                    eraseCookie('loginsignature');
                                    eraseCookie('resellername');
                                    eraseCookie('domainname');
                                    eraseCookie('username');
                                    eraseCookie('clients');
                                    eraseCookie('credit');
                                    eraseCookie('debit');
                                    eraseCookie('balance');
                                    eraseCookie('sales');
                                    eraseCookie('lastwithdrawal');
                                    eraseCookie('services');
                                    createCookie('loginsignature', jobj[0].signature, "");
                                    createCookie('resellername', jobj[0].name, "");
                                    createCookie('domainname', jobj[0].domainname, "");
                                    createCookie('username', jobj[0].username, "");
                                    var dbd = response.data.dashboarddata;
                                    createCookie('clients', dbd[0].clients, "");
                                    createCookie('credit', dbd[0].credit, "");
                                    createCookie('debit', dbd[0].debit, "");
                                    createCookie('balance', dbd[0].balance, "");
                                    createCookie('sales', dbd[0].sales, "");
                                    createCookie('lastwithdrawal', dbd[0].lastwithdrawal, "");
                                    createCookie('services', JSON.stringify(srv));
                                    $scope.data.name = readCookie('resellername');
                                    $scope.data.domainname = readCookie('domainname');
                                    $scope.data.username = readCookie('username');
                                    $scope.data.loginsignature = readCookie('loginsignature');

                                    $scope.dashboarddata.clients = dbd[0].clients;
                                    $scope.dashboarddata.credit = dbd[0].credit;
                                    $scope.dashboarddata.debit = dbd[0].debit;
                                    $scope.dashboarddata.balance = dbd[0].balance;
                                    $scope.dashboarddata.sales = dbd[0].sales;
                                    $scope.dashboarddata.lastwithdrawal = dbd[0].lastwithdrawal;

                                    $scope.services.allservices = srv;
//                                    $location.path('/dashboard');
                                }
                            } else
                            {
                                $scope.signingin = false;
                            }
                        }, function (response) {
                            alert('Error login..');
                        });
            }
        } else
        {
            $scope.signedinsuccessfully = false;
            $scope.invalidusernamepwd = false;
            $scope.notactive = false;
            $scope.signingin = true;
            $http.post('logs.php', {fn: 'isloggedin', signature: readCookie('loginsignature'), ip: currentip}).then
                    (function (response) {
                        $scope.signingin = false;
                        console.log(response);
                        if (response.data.response == 1) {
                            var jobj = response.data.data;
                            if (jobj[0].response == 1)
                            {
                                console.log($location.path());
//                                                if ($location.path() == '/account/signin') {
//                                                    $location.path('/dashboard');
//                                                }
                                window.location = '/dashboard';
                            }
                        }
                    }, function (response) {
                        alert('Error checking isloggedin..');
                    });
        }
    }
    // sign in panel end
});

0 个答案:

没有答案