短鏈接/短網址+二維碼[開源]

開源地址

短鏈接/短網址/短地址,實現將形如:htts://www.xfunction/shortLink/index.html的網址收縮成https://xfu.biz/zdfXs形態的網址。

技術要點

  • 基本jquery,gulp打包。
  • 目錄結構:
    • html
      • include gulp打包時使用到的包含文件
      • html
        • index.html www.xfunction.cn的準靜態頁面。
        • shortLink
          • index.html 短鏈接生成操作頁面。
          • redirect.html 訪問短鏈接的跳轉頁面。
      • statics
        • css
        • font
        • images
        • js
          • min
            • clipboard.min.js 第三方拷貝
            • jqColorPicker.min.js 第三方着色選擇
            • mdb.js https://mdbootstrap.com/templates/ 模板
          • cropper.js
          • jquery-cropper.js 第三方截圖
          • qrcode.js 第三方二維碼生成
          • xfunction.qrcode.js 再封閉的二維碼生成
          • global.js 配置等常用工具
  • web服務器配置
    • 主域名www.xfunction.cn常規配置,不作特別說明。
    • 短鏈接域名 xfu.biz的nginx配置如下
    server {
          listen       443 ssl;
          server_name  xfu.biz;
          #ssl on;
          ssl_certificate   cert/xfu.biz.pem;
          ssl_certificate_key  cert/xfu.biz.key;
          ssl_session_timeout 5m;
          ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
          ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
          ssl_prefer_server_ciphers on;
    
          #charset koi8-r;
    
          access_log  logs/xfu.access.log  main;
          ## redirect 確保日誌記錄完整,否則 301 客戶端記住了,就不來了
    
          location / {
              root   /project/run/www;
              index  index.html index.htm;
              rewrite ^/(.+)$ https://www.xfunction.cn/html/shortLink/redirect.html?linkId=$1 redirect;
          }
    }
    
    

API應用服務在( xfunction-api )中的位置

  • modules/shortlink/* 短鏈接相關

生成頁面
生成結果
首頁

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