<script type="text/javascript">
    $(document).ready(function(){
        $('.btn-act').click(function(){
            var act=$(this).attr('act');   
            refresh(act);
        });

        function refresh(action){
            if($.isEmpty('#code0')){
                toastr.error(
                    '请先输入标签号码!', 
                    "操作错误：",
                    {timeOut: 800, positionClass: "toast-center-center"}
                );            
            }else{               
                var c=$('#code0').val();
                $('#code').val('');
                $.ajax({
                    type:'GET',                           
                    url:'/utils/label/encode/'+action+'/?label='+c,                
                    dataType:'json',
                    success: function(d) {
                        if(d.e==''){
                           $('#code').val(d.result.code);
                        }else{
                            toastr.error(
                                '操作失败!', 
                                "提示：",
                                {timeOut: 800, positionClass: "toast-center-center"}
                            );                        
                        }
                    }                
                });
            }
        };
        
    });
</script>


<style>
  
   
</style>


<ol class="breadcrumb">
    <li>系统工具</li>
    <li>明码加密V2</li>    
</ol>


<div class="clearfix"></div>


<div class='x_panel' >

    <form role="form" class="form-horizontal">
       
        <div class="form-group">
            <label class="col-sm-1 control-label">原码：</label>
            <div class="col-sm-9"><input class='form-control' placeholder="请输入12位标签号码" id='code0' /></div>
            <div class='col-sm-2'>
                <a type='button' act='encrypt' class='btn btn-primary btn-act'>加密</a>
                <a type='button' act='decrypt' class='btn btn-primary btn-act'>解密</a>
            </div>    
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">结果：</label>
            <div class="col-sm-9"><input class='form-control' id='code' /></div>
                  
        </div>
        <div style='margin-top:50px;'>
            <p>此页面仅用于验证云平台系统内V2版加解密算法</p>            
        </div>
    </form>

</div>
