PageSourceSearch

https://www.2898.com/js/member/user/login.js?v=2021041918

js 2898.com collected 2026-10-06 19:44:16 UTC 5,055 bytes, 133 lines download raw bytes

1app.controller("ctrlArea",function($scope,$http,qrcodeLogin,common,$rootScope){
2    $scope.isLoginType = 'password'; //登录方式:qrcode二维码,password密码登录
3    $scope.qrLogin = qrcodeLogin;
4    $rootScope.common = common;
5    $rootScope.common.getCart();  // 1友链  2图文
6
7    $scope.isLoginTypeFun = function(key){
8        $scope.isLoginType = key
9        $scope.qrLogin.closeOpen();
10        if(key == 'qrcode'){
11            $scope.qrLogin.isOpen();
12        }
13    }
14
15    $scope.error = {
16        account:'',
17        password:'',
18        verfiyCode:false
19    }
20    $scope.error_verfiy = false;
21    $scope.autoLogin = true;
22    $scope.account = '';
23    $scope.password = '';
24    $scope.autoFun = function(){
25        $scope.autoLogin = $scope.autoLogin?false:true;
26    }
27    $scope.changeAccount = function() {
28        if ($scope.account=='') {
29            $scope.error.account = '请输入帐号';
30            return false;
31        } else {
32            $scope.error.account = '';
33            return true
34        }
35    }
36    $scope.changePass = function(){
37        if($scope.password==''){
38            $scope.error.password = '请输入密码';
39            return false;
40        }else{
41            $scope.error.password = '';
42            return true;
43        }
44    }
45    $scope.beginLogin = function(obj){
46        var ac = $scope.changeAccount();
47        var pa = $scope.changePass();
48        if(!obj)return;
49        if(ac && pa) {
50            var geetest_challenge = $('input[name=geetest_challenge]').val();
51            var geetest_validate = $('input[name=geetest_validate]').val();
52            var geetest_seccode = $('input[name=geetest_seccode]').val();
53            if(!geetest_challenge || !geetest_validate || !geetest_seccode){
54                showVerfiyMsg();
55                return;
56            }
57            var arg = {
58                account:$scope.account,password:$scope.password,autologin:$scope.autoLogin,
59                geetest_challenge:geetest_challenge,geetest_validate:geetest_validate,geetest_seccode:geetest_seccode
60            }
61            $http.get(memberUrl('/user/logined',arg)).success(function(data){
62                if(data.statusCode!=200){
63                    if(obj)obj.reset();
64                }
65                switch(data.statusCode){
66                    case 200:
67                        $scope.cokie = getCookie('newUser');
68                        window.location.href = referer;
69                        break;
70                    case 508:
71                        showVerfiyMsg();
72                        break;
73                    default :
74                        $scope.error.account= data.message
75                        break;
76                }
77            }).error(function(error){
78                httpError(error);
79            })
80        }
81    }
82    var showVerfiyMsg = function(){
83        $("#notice")[0].className = "help-block text-red has-icon-error";
84        setTimeout(function () {
85            $("#notice")[0].className = "hidden";
86        }, 2000);
87    }
88    var handlerEmbed = function (captchaObj) {
89        $("#embed-submit").click(function (e) {
90            var validate = captchaObj.getValidate();
91                if (!validate) {
92                    showVerfiyMsg();
93                    e.preventDefault();
94                } else {
95                    $scope.beginLogin(captchaObj);
96                }
97        });
98        // 将验证码加到id为captcha的元素里,同时会有三个input的值:geetest_challenge, geetest_validate, geetest_seccode
99        captchaObj.appendTo("#embed-captcha");
100        captchaObj.onReady(function () {
101            $("#wait")[0].className = "hidden";
102        });
103        captchaObj.on
104        // 更多接口参考:http://www.geetest.com/install/sections/idx-client-sdk.html
105    };
106    $http.get(indexUrl('/Geetest/getverfiy',{t:(new Date()).getTime()})).success(function(data){
107        initGeetest({
108            gt: data.gt,
109            challenge: data.challenge,
110            new_captcha: data.new_captcha,
111            product: "embed", // 产品形式,包括:float,embed,popup。注意只对PC版验证码有效
112            offline: !data.success // 表示用户后台检测极验服务器是否宕机,一般不需要关注
113            // 更多配置参数请参见:http://www.geetest.com/install/sections/idx-client-sdk.html#config
114        }, handlerEmbed);
115    }).error(function(error){
116        httpError(error);
117    });
118})
119
120//获取cokie中写入的值
121function getCookie(c_name) {
122    if (document.cookie.length > 0) {
123        c_start = document.cookie.indexOf(c_name + "=")
124        if (c_start != -1) {
125            c_start = c_start + c_name.length + 1
126            c_end = document.cookie.indexOf(";", c_start)
127            if (c_end == -1) c_end = document.cookie.length
128            return unescape(document.cookie.substring(c_start, c_end))
129        }
130    }
131    return ""
132}
133

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.