2018-09-19 21:35:02   Visit  2

在conf问价的http内添加以下代码

# gzip压缩功能设置
gzip on; #开启gzip压缩输出
gzip_min_length 1k; #最小压缩文件大小
gzip_buffers 4 16k; #压缩缓冲区
gzip_http_version 1.0; #压缩版本(默认1.1,前端如果是squid2.5请使用1.0)
gzip_comp_level 2; #压缩等级
gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; #压缩类型,默认就已经包含text/html,所以下面就不用再写了,写上去也不会有问题,但是会有一个warn。
    gzip_vary on;
2018-08-19 00:12:00   Visit  58

Elementui 导航组件和Vuejs路由结合, 达到点击导航切换路由,根据路由定位导航

一下是nav.vue代码,导航数据以json格式配置

<template>
 <el-menu  :default-active=\"$route.path\" 
      class=\"el-menu-vertical-demo\"
      router=true
      @open=\"handleOpen\"
      @close=\"handleClose\"
      background-color=\"#545c64\"
      text-color=\"#fff\" 
      active-text-color=\"#ffd04b\"
      v-bind:aa=\"$route.path\" >
      <template  v-for=\"item in menuDatas\">
          <el-submenu  v-if=\"item.children&&item.children.length>0\" v-bind:key=\"item.index\" v-bind:index=\"item.src\">
              <template slot=\"title\">
                <i class=\"el-icon-location\"></i>   
                <span  >{{ item.title }}</span>
              </template>
              <el-menu-item-group  v-if=\"item.children&&item.children.length>0\" > 
                <el-menu-item   v-for=\"item in item.children\"  v-bind:key=\"item.index\" v-bind:index=\"item.src\" > 
                  <span >{{ item.title }}</span>
                </el-menu-item> 
              </el-menu-item-group> 
          </el-submenu>
          <el-menu-item  v-else v-bind:key=\"item.index\" v-bind:index=\"item.src\">
            <i class=\"el-icon-menu\"></i>
            <span  >{{ item.title }}</span>
          </el-menu-item>
      </template>
     
 
  </el-menu>
 
</template>

<script>
export default {
  name: \"LeechgNav\",
  data: function() {
    var menuDatas = [
      {index:\"1\", type: \"href\", title: \"导航一\", icon: \"\", src: \"/1\", children: [
        {index:\"1-2\",  type: \"href\", title: \"选项一\", icon: \"\", src: \"/index\", children: [] },
        {index:\"1-3\",  type: \"href\", title: \"选项二\", icon: \"\", src: \"/lee\", children: [] },
        {index:\"1-4\",  type: \"href\", title: \"选项三\", icon: \"\", src: \"/lee2\", children: [] }
      ] },
      {index:\"2\",  type: \"href\", title: \"导航二\", icon: \"\", src: \"/2\", children: [] },
      {index:\"3\",  type: \"href\", title: \"导航三\", icon: \"\", src: \"/3\", children: [] },
      {index:\"4\",  type: \"href\", title: \"导航四\", icon: \"\", src: \"/4\", children: [] }
    ];
    return {
      greeting: \"Hello\",
      menuDatas
    };
  }
};
</script>
<style>
.leechg_index {
  background-color: red;
  color: white;
}

.el-row {
  margin-bottom: 20px;
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  background: #d3dce6;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
a{
  color: white;
  text-decoration: none;
  color: inherit;
  text-decoration: inherit;
}
</style>

2018-08-10 11:01:41   Visit  47
a点到b的射线方位角   Math.atan2(b.y-a.y,b.x-a.x)*180/Math.PI

转:javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 解决方案
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 解决方案
这个是jdk导致的,jdk里面有一个jce的包,安全性机制导致的访问https会报错,官网上有替代的jar包,换掉就好了

目录 %JAVA_HOME%\jre\lib\security里的local_policy.jar,US_export_policy.jar

JDK7 http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html

JDK8 http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html

https://www.cnblogs.com/1995hxt/p/6185399.html

2018-07-28 22:28:51   Visit  75

select 'alter system kill session '''||sid|| ','||serial#||''';' from v$session where username =' ';

2018-07-28 22:21:17   Visit  56

select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0

2018-07-27 21:12:49   Visit  89

sdo_relate(t.geom, sdo_geometry(:geometry,null),\'mask=ANYINTERACT\')=\'TRUE\'

JavaScript在浏览器中把文本保存为文件的方法

经过测试第二种方法可以保存更多的文本不至于卡死

var saveTextAsFile1 = function (text, fileName, success, error) {
    var data = text;
    if (!(text instanceof Array)) {
        data = [text];
    }
    var file = new File(data, fileName);
    var reader = new FileReader();
    reader.readAsDataURL(file);
    reader.onload = function (r) {
        var url = reader.result;
        downLoadFile(url, fileName,
            function () {
                success && success();
            }, function () {
                error && error();
            });
    };


}

/**
 * 下载文件
 * @param {string, Array} text 
 * @param {string} fileName 
 * @param {function} success 
 * @param {function} error 
 */
var saveTextAsFile = function (text, fileName, success, error) {
    var data = text;
    if (!(text instanceof Array)) {
        data = [text];
    }
    var urlObject = window.URL || window.webkitURL || window;
    var export_blob = new Blob(data);
    var url = urlObject.createObjectURL(export_blob);
    downLoadFile(url, fileName,
        function () {
            success && success();
        }, function () {
            error && error();
        });
}
2018-07-26 01:00:21   Visit  69

jQuery 获取指定url标题



function getTitleOfUrl(u, callback) {
    var url = \\\"jsapi/proxy.jsp?\\\" + u;
    $.ajax({
        url: url,
        complete: function (e) {
            var text = e.responseText;
            text = text.replace(/\\\\s*/g,\\\"\\\");
            var reg = /<title>(.*)\\\\<\\\\/title>/;
            window.b = e;
            title = text.match(reg)[1];
            callback&&callback(title,e)
        }
    })
}
var u = \\\"http://leechg.com\\\";
getTitleOfUrl(u, function(title,e){
    console.log(title)
})

2018-07-04 15:02:10   Visit  65

bootstrapValidator 同一个页面两个form

bootstrapValidator 同一个页面两个form出现随机一个form无法验证的问题

经验证发现是页面内通过ajax加载子页面内容导致 bootstrapValidator .js重复加载,bootstrapValidator 没有记住之前配置的验校内容,导致后一个加载的子页面上的form没法验校。

解决方法

在子页去掉bootstrapValidator .js的加载

bootstrapValidator 不符合jQuery组件的画风

©2017 Leechg.com