【日常】淺談項目經理與研發間的“代溝”

保研之後選擇在學校教務處做助管,有點不思進取,主要覺得出去實習太累了,而且套路太深,與其給別人打工還不如給自家人打工,而且待遇也不差,工作時間也很理想,關鍵是壓力小,之前在私募實習,老闆就坐在你背後,敲幾行代碼都人頭皮發麻。

最近中國知網準備在本校推廣他們的作業管理系統,宣稱可以在檢測出學生之間論文,報告甚至代碼的抄襲(細思恐極)。CC把對接這事兒扔給我辦了,第一次做乙方,想想還有些小激動。

上來第一件事情就是創建賬號,然後就遇到了讓我頭皮發麻的事情。這事起結因還挺有意思。

1 問題發現

知網給我的用戶文檔是說創建賬號後會有一個默認密碼,我創建完自然是會隨機挑選幾個賬號測試一下賬號密碼是否正確,結果我遇到的“症狀”是我偶爾可以登錄成功一次,然後接下來很多次都登錄不成功,頁面提示“用戶名或密碼錯誤!”

我覺得很奇怪,跟項目經理反映,得到的解答是應該還是我導入賬號數據的EXCEL填得有問題,建議我刪掉賬號,重新導入。【黑人問號臉?】

沒辦法我也就認了,關鍵這系統還沒有批量刪除賬號的功能,只能全選一個頁面上的20個賬號,結果我手動刪了幾百頁的賬號,“全選-->刪除-->下一頁”,點得我手都麻了。

導入完已經快要下班,隨手測了一個賬號密碼,Bingo,萬事大吉。

結果昨天我補錄了一批賬號,測試發現還是一樣的問題,我猜想可能是連續兩次登錄間隔時間不能太短吧,我等了一個小時,發現還是提示“用戶名密碼錯誤!”

與其坐等甲方改進,不如自己動手豐衣足食。我決定查查這個系統的問題在哪裏。

我先把當前時間節點上的下面這張截圖中的登錄頁面的HTML複製一份以供下文的參考(下文中所有的代碼都從這裏截出):

有點長,跳過即可!!!!!!!

<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Expires" content="0">
    
    <title>登錄</title>

    <link href="/cm/Style/css/resetCss.css" rel="stylesheet">
    <link href="/cm/Style/css/easyui.css" rel="stylesheet">
    <link href="/cm/Style/css/icon.css" rel="stylesheet">
    <link href="/cm/Style/css/qhStyle.css" rel="stylesheet">
     <link href="/cm/Style/css/animate.css" rel="stylesheet">
    <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
    <style>
        .liLab_paswd input {
            font-size: 10px;
        }

        .tabs-header,
        .tabs-tool {
            background-color: #fff;
            background: transparent;
            border: none;
        }

        .tabs-wrap {
            widows: 100% !important;
            margin: 0;
            padding-left: 10px;
            padding-right: 10px;
            box-sizing: border-box;
        }

        .tabs {
            width: 100%;
            text-align: center;
            height:40px!important;
        }

        .tabs li {
            width: 32%;
        }

        .tabs-scroller-right,
        .tabs-scroller-left {
            display: none !important;
        }

        .tabs-header .tabs-pill li a.tabs-inner {
            height: 26px !important;
            line-height: 23px !important;
            background: transparent;
            border: none;
            font-weight: bold;
            color:#666;
        }

        .tabs-header .tabs-pill li.tabs-selected a.tabs-inner {
            background: transparent;
            color: #75d2f1;
            filter: none;
            /*border-color: #fff;*/
            /* font-size: 14px; */
            font-weight: bold;
            border-radius: 0;
            border-bottom: 3px solid #75d2f1;
            width:100%;
            padding-bottom: 15px;
        }
        .panel-body{
            background:transparent;
            color:#666;
        }
        .tabs-title {
            font-size: 16px;
        }
        .login_backBox{
            width:1336px;
            height:682px;
            background:url("./Style/css/images/kczyLogin.png") no-repeat;
            background-size:100% 100%;
            position: absolute;
            left: 50%;
            margin-left: -668px;
            margin-top: 206px;
            z-index:10000;
        }
        .login_box {
            /*opacity: 0.95;*/
            /*background: rgba(255,255,255,0.5);*/
            margin-top: 16px;
            margin-left: 30px;
            width: 430px;
            height: 530px;
            margin-top: 16px;
            /*margin-left: 70px;*/

            
           
        }
        .tabs-header, .tabs-scroller-left, .tabs-scroller-right, .tabs-tool, .tabs, .tabs-panels, .tabs li a.tabs-inner, .tabs li.tabs-selected a.tabs-inner, .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, .tabs-header-left .tabs li.tabs-selected a.tabs-inner, .tabs-header-right .tabs li.tabs-selected a.tabs-inner{
             border-color: #d7d8d8;
        }
         
        @media (min-width: 768px) {
            .login_box {
                /*margin-left: 80px;*/
        }
        }

        @media (min-width: 992px) {
            .login_box {
                /*margin-left: 100px;*/
        }
        }

        @media (min-width: 1200px) {
            .login_box {
                /*margin-left: 160px;*/
            }
        }

        .tabs-panels {
            border:none;
            height: 480px !important;
            /*padding: 20px 75px 0px 100px;*/
            /*box-sizing: border-box;*/
        }

        .zhanghaoDiv.panel-body {
            padding: 0px 25px 50px !important;
            box-sizing: border-box;
            width: 100% !important;
            height: 100% !important;
        }

        .loginCj_ul li.liLab_user {
            /*margin-bottom: 0;*/
        }

        .loginCj_ul li.rule_li {
            border: none;
            color: #ce942c;
            font-size: 13px;
            margin-bottom: 6px;
            margin-top: 0;
            padding-left: 30px;
        }

            .loginCj_ul li.rule_li span {
                display: block;
        }

        #divWeixinLogin {
            overflow: hidden;
            text-align:center;
        }

        .lgBtnWp {
            margin-top: 40px;
        }

        .yzmImg {
            margin-left: 130px;
            overflow:inherit;
        }

        .liLab_yzm {
            width: 182px;
        }
        .loginCj_ul input, .loginCj_ul .textbox, .loginCj_ul .validatebox-invalid {
            padding-left: 5px;
        }
        .loginCj_ul{
            position:relative;
        }
        .loginCj_ul li {
             height: 50px;
            /* margin-top: 30px; */
            border: none;
            /* border-bottom: 1px solid #ccc; */
            width: 100%;
            background: #fff;
            margin-bottom: 20px;
            line-height: 50px;
            padding-left:5px;
            border:1px solid #ccc;
        }

        .sge_Log_Main {
            overflow: visible;
            z-index:10000;
        }
       
        .tabs-wrap {
            width: 100%!important;
            margin: 0 auto!important;
            margin-top: 20px !important;

        }
        .schoolName{
            line-height: 40px;
            width: 248px;
            border: 1px solid #ccc;
            /* margin-left: 30px; */
            /* border-top: 0px; */
            color: #333;
            font-size: 16px;
            padding-left: 10px;
            cursor: pointer;
            display: none;
            position: absolute;
            top: 55px;
            width: 98%;
            background: #fff;
            left: 0;
        }
        .schoolName:hover{
            background:#10b1e6;
            color:#fff;
        }

        /*添加動態效果的新樣式*/
        .main_wrapper{
            height:883px;
            width:100%;
            background:url("./Style/css/images/kczy_bcg.jpg") no-repeat;
            background-size:100% 100%; 
            position:relative;
            font-family:Source Han Sans CN;
        }
        .main_title{
            color:#fff;
            font-size:37px;
            /*margin:0 auto;*/
            padding-top:115px;
            /*width:100%;*/
            /*text-align:center;*/
            /*margin-left:310px;*/
            width: 646px;
            position: absolute;
            left: 50%;
            margin-left: -665px;
            font-weight:bold;
        }
       .login_btn{
            width: 100%;
            height: 50px;
            line-height: 36px;
            font-family: "微軟雅黑";
            font-size: 27px;
            color: #fff;
            background: #10b1e6;
            text-align: center;
            border: 0;
            outline: none;
            cursor: pointer;
            /*-moz-border-radius: 3px;*/
            /* -webkit-border-radius: 3px; */
            /* border-radius: 3px; */
       }
       .a_hui{
           color:#666;
       }
       .login_btn:hover{
           background:#10b1e696;
       }
       .liLab_user label{
            background: url(./Style/css/images/login_icon4.png) no-repeat center center;
       }
       .bianhao_user label{
            background: url(./Style/css/images/login_icon3.png) no-repeat center center;
       }
       .liLab_paswd label{
           background: url(./Style/css/images/login_icon2.png) no-repeat center center;
       }
       .liLab_yzm label{
            background: url(./Style/css/images/login_icon1.png) no-repeat center center;
       }
       .ulBox{
           /*padding-top: 10px;
           padding-left: 346px;
           padding-right: 346px;
           min-width:700px;*/
           width:770px;
           float:left;
           box-sizing:border-box;
           padding-left:15px;
           margin-right:55px;
       }
       .ul_list{
           display: flex;
           flex-wrap: wrap;
           margin-top:46px;
       }
      .ul_list .li_item{
          /*float:left;*/
          width:33.3%;
          text-align:center;
          margin-top:36px;
          /*height:385px;*/
       }
      .ul_list .li_item .li_title{
          margin-top:15px;
          font-size:15px;
          font-weight:bold;
          color:#354168;
          margin-bottom:13px;
          padding: 0 46px;
      }
      .ul_list .li_item .li_con{
        font-size: 12px;
        font-weight:bold;
        color: #354168;
        padding: 0 25px;
        line-height: 19px;
        text-align:left;
        /*margin-bottom:60px;*/
      }
       .li_img{
           width:80px;
           height:70px;
       }
       .footer_box{
            border-top: 1px solid #b8c4ce;
            /*margin-top: 40px;*/
            padding-top: 20px;
            text-align: center;
            display: flex;
            justify-content: center;
            align-items: center;
            color:#000;
            background:#f4f4f4;
            padding-bottom:24px;
       }
       .footer_con{
           line-height:20px;
           text-align:left;
           margin-left:25px;
       }
       .model_title{
           /*height:31px;*/
           /*width:225px;*/
           padding:8px 15px 10px 20px;
           background:#a4f0e6;
           width: 351px;
           box-sizing: border-box;
           position: absolute;
           left: 422px;
           top: 25px; 
           font-weight: bold;
           font-size: 14px;

       }
    </style>
    <script type="text/javascript" src="/cm/Scripts/jquery.min.js"></script>
    <script type="text/javascript" src="/cm/Scripts/jsrender.js"></script>

    
    <script src="Scripts/jquery.easyui.min.js"></script>
    <script src="Scripts/commontask.js"></script>
<script src="moz-extension://8684ecf9-85c1-48f9-9293-aa784467c018/assets/prompt.js"></script></head>
<body class="">
    
    <div class="main_wrapper">
        <div class="main_title">
            <img src="./Style/css/images/cnki_logo.png" alt="login_img">“中國知網”課程作業管理系統
        </div>
        <div class="login_backBox">
            <div class="model_title">基於“中國知網”學術不端文獻檢測系統核心技術</div>
            <div class="ulBox">
                <ul class="ul_list clearfix">
                    <li class="li_item">
                        <img src="./Style/css/images/model_img1.png" alt="" class="li_img">
                        <div class="li_title">橫向檢測</div>
                        <div class="li_con">將上傳作業與知網已有學術期刊、博碩士學位論文等海量數據進行比對</div>
                    </li>
                    <li class="li_item">
                        <img src="./Style/css/images/model_img2.png" alt="" class="li_img">
                        <div class="li_title">縱向檢測</div>
                        <div class="li_con">將歷年電子版作業上傳至自建比對庫中,作爲檢測比對數據,防止上下年級學生間抄襲</div>
                    </li>
                    <li class="li_item">
                        <img src="./Style/css/images/model_img3.png" alt="" class="li_img">
                        <div class="li_title">校內互檢</div>
                        <div class="li_con">與校內同屆學生作業比對,防止同屆學生間相互抄襲</div>
                    </li>
                    <li class="li_item">
                        <img src="./Style/css/images/model_img4.png" alt="" class="li_img">
                        <div class="li_title">寫作訓練輔助</div>
                        <div class="li_con">在學生課程作業的完成過程中,爲學生提供不同階段所需寫作輔助服務</div>
                    </li>
                    <li class="li_item">
                        <img src="./Style/css/images/model_img5.png" alt="" class="li_img">
                        <div class="li_title">課程、教師/助教、學生網狀強關聯</div>
                        <div class="li_con">支持學生多門課程、多個課堂、多次作業、多個版本的提交、檢測和管理</div>
                    </li>
                    <li class="li_item">
                        <img src="./Style/css/images/model_img6.png" alt="" class="li_img">
                        <div class="li_title">多維統計分析</div>
                        <div class="li_con">支持按照課程作業、授課教師、學生等不同維度進行信息實時統計分析</div>
                    </li>
                </ul>
            </div>
            <div class="login_box  easyui-tabs tabs-container" style="" id="login_tab">
                
                

                
            <div class="tabs-header" style="width: 430px;"><div class="tabs-scroller-left" style="display: none;"></div><div class="tabs-scroller-right" style="display: none;"></div><div class="tabs-wrap" style="margin-left: 0px; margin-right: 0px; width: 430px;"><ul class="tabs tabs-pill" style="height: 26px;"><li class="tabs-first tabs-selected"><a href="javascript:void(0)" class="tabs-inner" style="height: 9.6px; line-height: 25.6px;"><span class="tabs-title">編號登錄</span><span class="tabs-icon"></span></a></li><li class=""><a href="javascript:void(0)" class="tabs-inner" style="height: 27px; line-height: 26px;"><span class="tabs-title">郵箱/用戶名登錄</span><span class="tabs-icon"></span></a></li><li class="tabs-last"><a href="javascript:void(0)" class="tabs-inner" style="height: 27px; line-height: 26px;"><span class="tabs-title">微信登錄</span><span class="tabs-icon"></span></a></li></ul></div></div><div class="tabs-panels" style="width: 430px;"><div class="panel" style="display: block;"><div title="" style="padding: 10px; width: 380px;" class="zhanghaoDiv panel-body panel-body-noheader panel-body-noborder" comment="" index="">
                <form id="formBox">
                <ul class="loginCj_ul form_ul">
                    <li class="bianhao_user">
                        <label class="textbox-label textbox-label-before" style="text-align: left; height: 50px; line-height: 30px;" for="_easyui_textbox_input8"> </label><input id="qianzhui_inp" type="text" class="easyui-textbox textbox-f" style="width: 370px; height: 50px; display: none;" data-options="label:' ',required:true,prompt:'請輸入前綴,確認學校'"><span class="textbox textbox-invalid" style="width: 335px; height: 50px;"><input id="_easyui_textbox_input8" type="text" class="textbox-text validatebox-text validatebox-invalid textbox-prompt" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 50px; line-height: 50px; width: 326px;" placeholder="請輸入前綴,確認學校" title=""><input type="hidden" class="textbox-value" value=""></span>
                    </li>
                    <div class="schoolName" style="display: none;"></div>
                    <li class="liLab_user">
                        <label class="textbox-label textbox-label-before" style="text-align: left; height: 50px; line-height: 30px;" for="_easyui_textbox_input2"> </label><input id="bianhao_inp" type="text" class="easyui-textbox textbox-f" style="width: 370px; height: 50px; display: none;" data-options="label:' ',required:true,prompt:'請輸入編號'"><span class="textbox textbox-invalid" style="width: 335px; height: 50px;"><input id="_easyui_textbox_input2" type="text" class="textbox-text validatebox-text validatebox-invalid textbox-prompt" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 50px; line-height: 50px; width: 326px;" placeholder="請輸入編號" title=""><input type="hidden" class="textbox-value" value=""></span>
                            
                    </li>
                    <li class="liLab_paswd">

                        <label class="textbox-label textbox-label-before" style="text-align: left; height: 50px; line-height: 30px;" for="_easyui_textbox_input3"> </label><input id="bianhao_paswd" type="password" class="easyui-textbox textbox-f" style="width: 370px; height: 50px; display: none;" data-options="label:' ',required:true,prompt:'........'"><span class="textbox textbox-invalid" style="width: 335px; height: 50px;"><input id="_easyui_textbox_input3" type="password" class="textbox-text validatebox-text validatebox-invalid textbox-prompt" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 50px; line-height: 50px; width: 326px;" placeholder="........" title=""><input type="hidden" class="textbox-value" value=""></span>

                    </li>
                    <li class="liLab_yzm" style="width:60%;">
                        <label class="textbox-label textbox-label-before" style="text-align: left; height: 50px; line-height: 30px;" for="_easyui_textbox_input4"> </label><input id="bianH_cord" type="text" class="easyui-textbox textbox-f" style="width: 110px; height: 50px; display: none;" data-options="label:' ',prompt:'驗證碼'"><span class="textbox" style="width: 75px; height: 50px;"><input id="_easyui_textbox_input4" type="text" class="textbox-text validatebox-text textbox-prompt" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 50px; line-height: 50px; width: 67px;" placeholder="驗證碼"><input type="hidden" class="textbox-value" value=""></span>

                        <span class="yzmImg">
                            <img id="bianHcode_img" src="LoginCheckCode.aspx?0.007710132963564598" alt="驗證碼" title="請將圖中的數字或者字母填寫到左邊的輸入框中,如果看不清楚,請點擊圖片更換" style="height: 100%; cursor: pointer;" onclick="this.src ='LoginCheckCode.aspx?'+Math.random();">
                        </span>
                    </li>
                
                </ul>
                </form>
                <div class="lgBtnWp">
                    <input type="button" id="bianH_login" class="login_btn" value="登 錄">
                    <span style="float: left; margin-top: 12px;"><a href="ReFindPwd.aspx" class="a_hui">找回密碼?</a></span>

                    

                </div>
            </div></div><div class="panel" style="display: none;"><div title="" style="padding: 10px; width: 380px;" class="zhanghaoDiv panel-body panel-body-noheader panel-body-noborder" \="" comment="" index="1">
                        <form id="form1">
                        <ul class="loginCj_ul form1_ul">
                            <li class="liLab_user">
                                <label class="textbox-label textbox-label-before" style="text-align: left; height: 50px; line-height: 30px;" for="_easyui_textbox_input5"> </label><input id="txtUserName" type="text" class="easyui-textbox textbox-f" style="width: 370px; height: 50px; border-left: 1px solid rgb(221, 221, 221); display: none;" data-options="label:' ',required:true,prompt:'請輸入正確郵箱格式,或者用戶名'"><span class="textbox textbox-invalid" style="width: 338.4px; height: 48.4px;"><input id="_easyui_textbox_input5" type="text" class="textbox-text validatebox-text validatebox-invalid textbox-prompt" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 48.4px; line-height: 48.4px; width: 330.4px;" placeholder="請輸入正確郵箱格式,或者用戶名"><input type="hidden" class="textbox-value" value=""></span>
                            
                            </li>
                             
                            <li class="liLab_paswd">

                                <label class="textbox-label textbox-label-before" style="text-align: left; height: 50px; line-height: 30px;" for="_easyui_textbox_input6"> </label><input id="txtPassowrd" type="password" class="easyui-textbox textbox-f" style="width: 370px; height: 50px; display: none;" data-options="label:' ',required:true,prompt:'........'"><span class="textbox textbox-invalid" style="width: 338.4px; height: 48.4px;"><input id="_easyui_textbox_input6" type="password" class="textbox-text validatebox-text validatebox-invalid textbox-prompt" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 48.4px; line-height: 48.4px; width: 330.4px;" placeholder="........"><input type="hidden" class="textbox-value" value=""></span>

                            </li>
                            <li class="liLab_yzm" style="width:60%;">
                                <label class="textbox-label textbox-label-before" style="text-align: left; height: 50px; line-height: 30px;" for="_easyui_textbox_input7"> </label><input id="txtCheckCode" type="text" class="easyui-textbox textbox-f" style="width: 110px; height: 50px; display: none;" data-options="label:' ',prompt:'驗證碼'"><span class="textbox" style="width: 78.4px; height: 48.4px;"><input id="_easyui_textbox_input7" type="text" class="textbox-text validatebox-text textbox-prompt" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 48.4px; line-height: 48.4px; width: 70.4px;" placeholder="驗證碼"><input type="hidden" class="textbox-value" value=""></span>

                                <span class="yzmImg">
                                    <img id="checkcode_img" src="LoginCheckCode.aspx?0.3123658270946086" alt="驗證碼" title="請將圖中的數字或者字母填寫到左邊的輸入框中,如果看不清楚,請點擊圖片更換" style="height: 100%; cursor: pointer;" onclick="this.src ='LoginCheckCode.aspx?'+Math.random();">
                                </span>
                            </li>
                
                        </ul>
                             </form>
                        <div class="lgBtnWp">
                            <input type="button" id="btnLogin" class="login_btn" value="登 錄">


                            <span style="float: left; margin-top: 12px;"><a href="ReFindPwd.aspx" class="a_hui">找回密碼?</a></span>

                            <span style="float: right; margin-top: 12px;">首次登錄, <a href="Register.aspx"><span style="color: #D74D4C;">請激活</span></a></span>

                        </div>
                    </div></div><div class="panel" style="display: none;"><div title="" style="padding-left:20px" id="divWeixinLogin" class="panel-body panel-body-noheader panel-body-noborder" comment="" index="2">
                        
                </div></div></div></div>
       
        </div>
        
        <ul class="bg-bubbles">
	            <li>
                    <img src="./Style/css/images/kczy_03.png" alt=" "></li>
	            <li> <img src="./Style/css/images/kczy_06.png" alt=" "></li>
	            <li> <img src="./Style/css/images/kczy_09.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_12.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_15.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_23.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_26.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_29.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_32.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_35.png" alt=" "></li>
	            <li><img src="./Style/css/images/kczy_42.png" alt=" "></li>
                <li><img src="./Style/css/images/kczy_39.png" alt=" "></li>
                <li><img src="./Style/css/images/kczy_47.png" alt=" "></li>
                <li><img src="./Style/css/images/kczy_52.png" alt=" "></li>
                <li><img src="./Style/css/images/kczy_50.png" alt=" "></li>
                <li><img src="./Style/css/images/kczy_54.png" alt=" "></li>
            </ul>
    </div>
    <!-- </div> -->
    
    

    <div class="footer_box">
        <div class="footer_img">
            <img src="./Style/css/images/footer_hui.png" alt="Alternate Text">
        </div>
        <div class="footer_con">
            <ul>
                <li>京ICP證040431號&nbsp;  網絡出版服務許可證(總)網出證(京)字第271號 
                    <a class="task_Log_a" target="_blank" href="https://ss.knet.cn/verifyseal.dll?sn=e13111111010043364isll000000&amp;a=1&amp;pa=0.08881110103584755">京公網安備11010802020460號</a>

                </li>
                <li>© 2009-2018 《中國學術期刊(光盤版)》電子雜誌社有限公司  &nbsp;平臺基礎技術由同方知網數字出版技術股份有限公司提供 
                </li>
                <li style="margin-top: 6px;">
                    <a href="https://ss.knet.cn/verifyseal.dll?sn=e13111111010043364isll000000&amp;a=1&amp;pa=0.08881110103584755" target="_blank">
                        <img src="/cm/Style/css/images/kxlogo.png"></a>
                    <a href="https://credit.cecdc.com/CX20140929005220005306.html" target="_blank">
                        <img src="/cm/Style/css/images/cxlogo.png"></a>
                </li>
            </ul>
        </div>
    </div>

    <script type="text/javascript">

        var lastUrl = "";

        var curURL = 'http://localhost:23448/Login.aspx';

        $(function () {
            $("#login_tab").tabs({
                border: true,
                pill: true
            });
           
            $(".easyui-tabs").tabs('select', parseInt(localStorage.getItem("loginType")));
            //$(".easyui-tabs").tabs('select', 2);
            $('#qianzhui_inp').textbox({//學校前綴檢索
                inputEvents: $.extend({},$.fn.textbox.defaults.inputEvents,{
                    keyup: function (event) {
                        $.get("LoginHandler.ashx",
                              {
                                  method: "getSchoolPreName",
                                  preName: $(event.target).val()
                              },
                       function (result) {
                           //MaskUtil.unmask();
                           var qianzhui_inpVal = '';
                           console.log('result=======', result)
                           if (result.isSuccess) {
                               var qianzhui_inp = $(event.target).val().replace("_", "")
                               console.log("qianzhui_inpVal", qianzhui_inp);
                               ; qianzhui_inpVal += qianzhui_inp + '_' + result.message;
                               $('#qianzhui_inp').textbox('textbox').attr('bianhao', qianzhui_inp + '_');
                               $(".schoolName").html(qianzhui_inpVal);
                               $(".schoolName").css("display", "block");
                           } else {
                               $(".schoolName").css("display", "none");
                           }
                       });
                        if ($(event.target).val().length==0) {
                            $(".schoolName").css("display", "none");
                        }
                     
                    }
                      
                })
            })
            $(".schoolName").click(function () {//點擊學校事件
                //$("#qianzhui_inp").val(qianzhui_inpVal);
                $("#qianzhui_inp").textbox('setValue', $(this).html());
                $(this).css("display", "none");
            })
             //$('#bianhao_inp').textbox({//編號焦點事件
             //    inputEvents: $.extend({}, $.fn.textbox.defaults.inputEvents, {
             //        keyup: function (event) {
             //            if ($("#qianzhui_inp").val().length > 0) {
             //                if ($("#qianzhui_inp").val() !== $(".schoolName").html()) {
             //                    $.MsgBox.Alert("請先選擇學校");
             //                }
             //            }
             //        }

             //    })
             //})

            //簡繁切換


             
           
            $("#bianH_login").click(function () {//編號登錄
                var flag = $("#formBox").form('validate');
                if (!flag) {
                    return false;
                }
                if (flag) {
                    //MaskUtil.mask('正在提交數據...');
                }
                var code = $("#bianH_cord").val();
                var loginusername = $("#qianzhui_inp").textbox('textbox').attr('bianhao') + $("#bianhao_inp").val();
                var loginpassword = $("#bianhao_paswd").val();
                var type = 0;
                login(loginusername, loginpassword, code, type);
                 
            });

            $("#btnLogin").click(function () {//郵箱登錄
                var flag = $("#form1").form('validate');
                if (!flag) {
                    return false;
                }
                if (flag) {
                    //MaskUtil.mask('正在提交數據...');
                }
                var code = $("#txtCheckCode").val();
                var loginusername = $("#txtUserName").val();
                var loginpassword = $("#txtPassowrd").val()
                var type = 1;
                login(loginusername, loginpassword, code,type);

            });
            function login(loginusername, loginpassword, code,type) {
                //再次登錄
                $.get("LoginHandler.ashx",
                      {
                          method: "login",
                          code: code,
                          loginusername: loginusername,
                          loginpassword: loginpassword
                      },
                       function (result) {
                           //MaskUtil.unmask();
                           var json = eval(result);
                           if (json.isSuccess) {
                               window.location.href = json.message;
                               localStorage.setItem("loginType", type);
                           } else {
                               if(type==1){
                                   $("#checkcode_img").attr("src", 'LoginCheckCode.aspx?' + Math.random());
                               } else {
                                   $("#bianHcode_img").attr("src", 'LoginCheckCode.aspx?' + Math.random());
                               }
                               $.MsgBox.Alert(json.message);

                           }
                       });
            }
            $(document).keydown(function (event) {
                if (event.keyCode == 13) {
                    console.log(event)
                    console.log($(event.target).parent().parent().parent())
                    if ($(event.target).parent().parent().parent().hasClass("form_ul")) {//編號登錄
                                    
                        $("#bianH_login").click()
                    } else {
                        $("#btnLogin").click()
                    }
                    //$("#btnLogin").click();
                };
            });
        });

        function clearForm() {
            $('#form1').form('clear');
        }
        //tab切換事件
        $('#login_tab').tabs({
            border:false,
            onSelect: function (title, index) {
                console.log("index=====", index);
                if (index == 1) {
                    $("#checkcode_img").attr("src", 'LoginCheckCode.aspx?' + Math.random());
                } else {
                    $("#bianHcode_img").attr("src", 'LoginCheckCode.aspx?' + Math.random());
                }
                //$.MsgBox.Alert(index + ' is selected');
                if (index == 2) {
                    var obj = new WxLogin({

                        id: "divWeixinLogin",    //div的id

                        appid: "wxbeeaa16eb8ba54e0",

                        scope: "snsapi_login",

                        redirect_uri: encodeURI("http://co.cnki.net/WeChat/WeChatBinding.html?domain=@CouseWork@"),
                        //回調地址

                        state: "1",         //參數,可帶可不帶

                        style: "",         //樣式  提供"black"、"white"可選,默認爲黑色文字描述

                        href: ""                 //自定義樣式鏈接,第三方可根據實際需求覆蓋默認樣式。

                    });
                }
            }
        });
       
    </script>


</body></html>

2 問題檢測

登錄頁面👇

用戶手冊上給出登錄方式是第一個input框填寫"<學校前綴>_<編號>",第二個編號input框填寫"<編號>",然後密碼驗證碼就可以登錄了。我測試了兩種完全相同的輸入,分別登錄成功與登陸失敗,並監聽網頁的POST請求參數,得到了以下的截圖:

登錄成功的POST參數👇

登陸失敗的POST參數👇

我發現登錄失敗的原因是因爲學校前綴檢測出錯了,以這個undefined的情況可以看出,大概率不是服務後端處理時的問題,而是在前端的JS上出現了undefined的數據類型給返回。 於是我猜測在上面的HTML代碼裏的<script>腳本中可以找到問題所在。

於是我定位到了這段JS👇

            $("#bianH_login").click(function () {//編號登錄
                var flag = $("#formBox").form('validate');
                if (!flag) {
                    return false;
                }
                if (flag) {
                    //MaskUtil.mask('正在提交數據...');
                }
                var code = $("#bianH_cord").val();
                var loginusername = $("#qianzhui_inp").textbox('textbox').attr('bianhao') + $("#bianhao_inp").val();
                var loginpassword = $("#bianhao_paswd").val();
                var type = 0;
                login(loginusername, loginpassword, code, type);
                 
            });

顯然是$("#qianzhui_inp").textbox('textbox').attr('bianhao')返回了undefined,於是我認爲問題出在這個上面。我向項目經理反映了我出現的問題的狀況,並向他指出BUG的位置,希望他與研發溝通,加以優化。

然後我得到了這樣的回覆👇

神TM的模糊輸入!顯然他並沒有GET到我的POINT,研發也沒有GET到他的POINT,而他回覆我的時候也沒有GET到研發的POINT,所以我雖然能GET到他的POINT,但是我也無可奈何。

3 問題解決

我今天再來測試還是同樣的問題“症狀”,於是我今天決定徹查這個BUG究竟是在什麼地方。

通過$("#qianzhui_inp").textbox('textbox').attr('bianhao')我定位到id爲qianzhui_inp的標籤👇

<input id="qianzhui_inp" type="text" class="easyui-textbox textbox-f" style="width: 370px; height: 50px; display: none;" data-options="label:' ',required:true,prompt:'請輸入前綴,確認學校'"><span class="textbox" style="width: 335px; height: 50px;"><input id="_easyui_textbox_input8" type="text" class="textbox-text validatebox-text" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 50px; line-height: 50px; width: 327px;" placeholder="請輸入前綴,確認學校"><input type="hidden" class="textbox-value" value="shufe"></span>

事實上該標籤裏面並沒有名稱爲'bianhao'的屬性,然而當我在也頁面上輸入完編號後,我再截取這段HTML,它變成了👇

<input id="_easyui_textbox_input8" type="text" class="textbox-text validatebox-text" autocomplete="off" tabindex="" style="text-align: start; margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 50px; line-height: 50px; width: 326px;" placeholder="請輸入前綴,確認學校" title="" bianhao="shufe_"><input type="hidden" class="textbox-value" value="shufe"></span>

 名稱爲'bianhao'的屬性出現了(bianhao='shufe_'),所以顯然這是JS添加給它添加了屬性,我繼續在<script>腳本中搜索,找到了這段JS👇

            $('#qianzhui_inp').textbox({//學校前綴檢索
                inputEvents: $.extend({},$.fn.textbox.defaults.inputEvents,{
                    keyup: function (event) {
                        $.get("LoginHandler.ashx",
                              {
                                  method: "getSchoolPreName",
                                  preName: $(event.target).val()
                              },
                       function (result) {
                           //MaskUtil.unmask();
                           var qianzhui_inpVal = '';
                           console.log('result=======', result)
                           if (result.isSuccess) {
                               var qianzhui_inp = $(event.target).val().replace("_", "")
                               console.log("qianzhui_inpVal", qianzhui_inp);
                               ; qianzhui_inpVal += qianzhui_inp + '_' + result.message;
                               $('#qianzhui_inp').textbox('textbox').attr('bianhao', qianzhui_inp + '_');
                               $(".schoolName").html(qianzhui_inpVal);
                               $(".schoolName").css("display", "block");
                           } else {
                               $(".schoolName").css("display", "none");
                           }
                       });
                        if ($(event.target).val().length==0) {
                            $(".schoolName").css("display", "none");
                        }
                     
                    }
                      
                })
            })

真相大白!這段代碼告訴我監聽器監聽該標籤的輸入情況,只要有輸入則會去模糊匹配學校前綴(並且從這段代碼可以看出,根本不需要在第一個框中輸入"<學校前綴>_<編號>"的格式,只需要"<學校前綴>"就完事了)。

我之所以某一次登錄成功,然後之後好多次再也無法登錄成功的原因我也找到了:
    - 我的操作過程是這樣的:導入完學生後我會去檢查隨便挑幾個學生的學號測試一下密碼,防止密碼會出錯
    - 而網頁頁面源代碼上JS中的邏輯是這樣的:
      (1) 當我在第一個輸入框中輸入學校前綴:"shufe_學號"(其實只要輸入"shufe"就足夠了)後,網頁會把輸入的信息傳送回服務器中檢查前綴並把模糊處理後的前綴(即"shufe_")以屬性的方式添加到第一個輸入框的標籤(即<input>--><input bianhao="shufe_">),然後登錄時網頁會找到這個'bianhao="shufe_"'並把它作爲真實的前綴用於登錄。
      (2) 注意到:這種屬性添加事件必鬚髮生在我在第一個輸入框中輸入信息後纔會出現,如果我不在第一個輸入框中輸入信息就不會有'bianhao="shufe_"'這個字段出現;
      (3) 而我實際操作時先登錄一個學生的賬號,發現密碼正確,然後我就會點擊瀏覽器左上角的“後退鍵”返回到前一個頁面(即登錄頁面),準備進行下一個學生賬號的登錄操作;
      (4) 問題就在於此:我點擊後退鍵返回前一個頁面時輸入框裏的信息並沒有消失(即第一個輸入框裏本來就已經填好"shufe"了),我自然不會去再進行輸入前綴(反正都是"shufe")的操作,於是網頁沒有監聽到我輸入前綴的事件,所以不會把'bianhao="shufe_"'添加到<input>中,而登錄時找不到'bianhao="shufe_"',所以就返回了undefined。

我也缺乏前端開發的經驗,不知道這種問題算不算是一種缺陷,因爲畢竟用戶很少會後退網頁再重新登錄,但是就我自己的用戶體驗來說真的很差,而且我覺得其他學校的管理員也可能會遇到同樣的困擾。於是我還是跟經理說了這個問題的本質,但願他能GET到我的POINT罷👇

後記

其實從我的角度看這種網頁肯定是年輕的新手做出的系統(就像我一樣),搞不好還是一幫跟我年齡相仿的年輕人做的,而這些項目經理說實話大都中年左右,而且對研發大都知之甚少。年齡上是“代溝”,知識上也是“代溝”,而我作爲傀儡“乙方”跟經理之間也是一種“代溝”,這麼多溝溝渠渠做個事情真的是麻煩。說句實話搞項目真的是難,能單幹還是儘量單幹。

祝大家單幹做得巧,頭髮掉得早~


20191111更新

今早10點,該BUG已解決。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章