longyvfengyun
2023-04-12 ef4f300d8fe1843ad73da14ae421148eaab9a442
初次提交
4个文件已修改
5个文件已添加
2043 ■■■■■ 已修改文件
package-lock.json 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/js/Syunew3.js 715 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/js/ukey.js 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue 429 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/Syunew3.js 715 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/common.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
package-lock.json
@@ -2114,6 +2114,14 @@
      "integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=",
      "dev": true
    },
    "async-validator": {
      "version": "1.8.5",
      "resolved": "https://registry.npmjs.org/async-validator/-/async-validator-1.8.5.tgz",
      "integrity": "sha512-tXBM+1m056MAX0E8TL2iCjg8WvSyXu0Zc8LNtYqrVeyoL3+esHRZ4SieE9fKQyyU09uONjnMEjrNBMqT0mbvmA==",
      "requires": {
        "babel-runtime": "6.x"
      }
    },
    "asynckit": {
      "version": "0.4.0",
      "resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz",
@@ -2167,6 +2175,11 @@
        "resolve": "^1.12.0"
      }
    },
    "babel-helper-vue-jsx-merge-props": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-2.0.3.tgz",
      "integrity": "sha512-gsLiKK7Qrb7zYJNgiXKpXblxbV5ffSwR0f5whkPAaBAR4fhi6bwRZxX9wBlIc5M/v8CCkXUbXZL4N/nSE97cqg=="
    },
    "babel-loader": {
      "version": "8.1.0",
      "resolved": "https://registry.npm.taobao.org/babel-loader/download/babel-loader-8.1.0.tgz?cache=0&sync_timestamp=1584717315701&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-loader%2Fdownload%2Fbabel-loader-8.1.0.tgz",
@@ -2187,6 +2200,27 @@
      "dev": true,
      "requires": {
        "object.assign": "^4.1.0"
      }
    },
    "babel-runtime": {
      "version": "6.26.0",
      "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
      "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
      "requires": {
        "core-js": "^2.4.0",
        "regenerator-runtime": "^0.11.0"
      },
      "dependencies": {
        "core-js": {
          "version": "2.6.11",
          "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
          "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
        },
        "regenerator-runtime": {
          "version": "0.11.1",
          "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
          "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
        }
      }
    },
    "balanced-match": {
@@ -3819,8 +3853,7 @@
    "deepmerge": {
      "version": "1.5.2",
      "resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-1.5.2.tgz?cache=0&sync_timestamp=1572279720382&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdeepmerge%2Fdownload%2Fdeepmerge-1.5.2.tgz",
      "integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M=",
      "dev": true
      "integrity": "sha1-EEmdhohEza1P7ghC34x/bwyVp1M="
    },
    "default-gateway": {
      "version": "5.0.5",
@@ -4266,6 +4299,19 @@
      "resolved": "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.446.tgz",
      "integrity": "sha1-EsM2vIWOBNa2FKSI8y8t2JVhYB8=",
      "dev": true
    },
    "element-ui": {
      "version": "2.13.2",
      "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.13.2.tgz",
      "integrity": "sha512-r761DRPssMPKDiJZWFlG+4e4vr0cRG/atKr3Eqr8Xi0tQMNbtmYU1QXvFnKiFPFFGkgJ6zS6ASkG+sellcoHlQ==",
      "requires": {
        "async-validator": "~1.8.1",
        "babel-helper-vue-jsx-merge-props": "^2.0.0",
        "deepmerge": "^1.2.0",
        "normalize-wheel": "^1.0.1",
        "resize-observer-polyfill": "^1.5.0",
        "throttle-debounce": "^1.0.1"
      }
    },
    "elliptic": {
      "version": "6.5.2",
@@ -7255,6 +7301,11 @@
      "integrity": "sha1-suHE3E98bVd0PfczpPWXjRhlBVk=",
      "dev": true
    },
    "normalize-wheel": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
      "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
    },
    "npm-run-path": {
      "version": "2.0.2",
      "resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz",
@@ -8969,6 +9020,11 @@
      "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
      "dev": true
    },
    "resize-observer-polyfill": {
      "version": "1.5.1",
      "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
      "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="
    },
    "resolve": {
      "version": "1.17.0",
      "resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.17.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.17.0.tgz",
@@ -10113,6 +10169,11 @@
        "neo-async": "^2.6.0"
      }
    },
    "throttle-debounce": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-1.1.0.tgz",
      "integrity": "sha512-XH8UiPCQcWNuk2LYePibW/4qL97+ZQ1AN3FNXwZRBNPPowo/NRU5fAlDCSNBJIYCKbioZfuYtMhG4quqoJhVzg=="
    },
    "through": {
      "version": "2.3.8",
      "resolved": "https://registry.npm.taobao.org/through/download/through-2.3.8.tgz",
package.json
@@ -9,6 +9,7 @@
  },
  "dependencies": {
    "core-js": "^3.6.4",
    "element-ui": "^2.13.2",
    "vue": "^2.6.11"
  },
  "devDependencies": {
@@ -32,7 +33,9 @@
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
    "rules": {
      "no-console": "off"
    }
  },
  "browserslist": [
    "> 1%",
public/js/Syunew3.js
New file
@@ -0,0 +1,715 @@
function SoftKey3W()
{
    var isIE11 = navigator.userAgent.indexOf('Trident') > -1 && navigator.userAgent.indexOf("rv:11.0") > -1;
    var isEDGE= navigator.userAgent.indexOf("Edge") > -1;
    var u = document.URL;
    var url;
    if (u.substring(0, 5) == "https") {
        if(isIE11 || isEDGE)
        {
            url = "wss://127.0.0.1:4006/xxx";
        }
        else
        {
                url = "wss://localhost:4006/xxx";
            }
        } else {
            url = "ws://127.0.0.1:4006/xxx";
        }
    var Socket_UK;
    if (typeof MozWebSocket != "undefined") {
        Socket_UK = new MozWebSocket(url,"usbkey-protocol");
    } else {
        this.Socket_UK = new WebSocket(url,"usbkey-protocol");
    }
    this.FindPort = function(start)
    {
        var msg =
        {
            FunName: "FindPort",
            start: start
        };
        this.Socket_UK.send(JSON.stringify(msg));
   };
    this.FindPort_2 = function(start, in_data , verf_data)
    {
         var msg =
        {
            FunName: "FindPort_2",
            start: start,
            in_data: in_data,
            verf_data:verf_data
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.FindPort_3= function(start,in_data,verf_data)
    {
        var msg =
        {
            FunName: "FindPort_3",
            start: start,
            in_data: in_data,
            verf_data:verf_data
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetVersion= function(Path)
    {
        var msg =
        {
            FunName: "GetVersion",
            Path: Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetVersionEx= function(Path)
    {
        var msg =
        {
            FunName: "GetVersionEx",
            Path: Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetID_1= function(Path)
    {
        var msg =
        {
            FunName: "GetID_1",
            Path: Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetID_2= function(Path)
    {
        var msg =
        {
            FunName: "GetID_2",
            Path: Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.sRead= function(Path)
    {
        var msg =
        {
            FunName: "sRead",
            Path: Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.sWrite = function(InData, Path)
    {
         var msg =
        {
            FunName: "sWrite",
            InData: InData,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.sWrite_2= function(InData, Path)
    {
        var msg =
        {
            FunName: "sWrite_2",
            InData: InData,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.sWrite_2Ex= function(InData,Path)
    {
        var msg =
        {
            FunName: "sWrite_2Ex",
            InData: InData,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.sWriteEx= function(InData,Path)
    {
        var msg =
        {
            FunName: "sWriteEx",
            InData: InData,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.sWriteEx_New= function(InData,Path)
    {
        var msg =
        {
            FunName: "sWriteEx_New",
            InData: InData,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.sWrite_2Ex_New= function(InData,Path)
    {
        var msg =
        {
            FunName: "sWrite_2Ex_New",
            InData: InData,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetCal= function(Hkey,Lkey,new_Hkey,new_Lkey,Path)
    {
        var msg =
        {
            FunName: "SetCal",
            Hkey:   Hkey,
            Lkey:   Lkey,
            new_Hkey:new_Hkey,
            new_Lkey:new_Lkey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetBuf= function(InData,pos)
    {
        var msg =
        {
            FunName: "SetBuf",
            InData: InData,
            pos:pos
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetBuf= function(pos)
    {
        var msg =
        {
            FunName: "GetBuf",
            pos: pos
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YRead= function(Address,HKey,LKey,Path)
    {
        var msg =
        {
            FunName: "YRead",
            Address:Address,
            HKey:HKey,
            LKey:LKey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YWrite= function(InData,Address,HKey,LKey,Path)
    {
        var msg =
        {
            FunName: "YWrite",
            InData:InData,
            Address:Address,
            HKey:HKey,
            LKey:LKey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YReadEx= function(Address,len, HKey,LKey,Path)
    {
        var msg =
        {
            FunName: "YReadEx",
            Address:Address,
            len:len,
            HKey:HKey,
            LKey:LKey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YWriteEx= function(Address,len,HKey,LKey,Path)
    {
        var msg =
        {
            FunName: "YWriteEx",
            Address:Address,
            len:len,
            HKey:HKey,
            LKey:LKey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YReadString= function(Address,len,HKey,LKey,Path)
    {
        var msg =
        {
            FunName: "YReadString",
            Address:Address,
            len:len,
            HKey:HKey,
            LKey:LKey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YWriteString= function(InString,Address,HKey,LKey,Path)
    {
        var msg =
        {
            FunName: "YWriteString",
            InString:InString,
            Address:Address,
            HKey:HKey,
            LKey:LKey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetWritePassword= function(W_Hkey,W_Lkey,new_Hkey,new_Lkey,Path)
    {
        var msg =
        {
            FunName: "SetWritePassword",
            W_Hkey:W_Hkey,
            W_Lkey:W_Lkey,
            new_Hkey:new_Hkey,
            new_Lkey:new_Lkey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetReadPassword= function(W_Hkey,W_Lkey,new_Hkey,new_Lkey,Path)
    {
        var msg =
        {
            FunName: "SetReadPassword",
            W_Hkey:W_Hkey,
            W_Lkey:W_Lkey,
            new_Hkey:new_Hkey,
            new_Lkey:new_Lkey,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.DecString= function(InString,Key)
    {
        var msg =
        {
            FunName: "DecString",
            InString:InString,
            Key:Key
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.EncString= function(InString,Path)
    {
        var msg =
        {
            FunName: "EncString",
            InString:InString,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.EncString_New= function(InString,Path)
    {
        var msg =
        {
            FunName: "EncString_New",
            InString:InString,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.Cal= function(Path)
    {
        var msg =
        {
            FunName: "Cal",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.Cal_New= function(Path)
    {
        var msg =
        {
            FunName: "Cal_New",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetCal_2= function(Key,Path)
    {
        var msg =
        {
            FunName: "SetCal_2",
            Key:Key,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetCal_New= function(Key,Path)
    {
        var msg =
        {
            FunName: "SetCal_New",
            Key:Key,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetEncBuf= function(InData,pos)
    {
        var msg =
        {
            FunName: "SetEncBuf",
            InData:InData,
            pos: pos
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetEncBuf= function(pos)
    {
        var msg =
        {
            FunName: "GetEncBuf",
            pos: pos
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.ReSet= function(Path)
    {
        var msg =
        {
            FunName: "ReSet",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetID= function(Seed,Path)
    {
        var msg =
        {
            FunName: "SetID",
            Seed:Seed,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetProduceDate= function(Path)
    {
        var msg =
        {
            FunName: "GetProduceDate",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.MacAddr= function()
    {
        var msg =
        {
            FunName: "MacAddr"
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetChipID= function(Path)
    {
        var msg =
        {
            FunName: "GetChipID",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.StarGenKeyPair= function(Path)
    {
        var msg =
        {
            FunName: "StarGenKeyPair",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GenPubKeyY= function()
    {
        var msg =
        {
            FunName: "GenPubKeyY"
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GenPubKeyX= function()
    {
        var msg =
        {
            FunName: "GenPubKeyX"
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GenPriKey= function()
    {
        var msg =
        {
            FunName: "GenPriKey"
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetPubKeyY= function(Path)
    {
        var msg =
        {
            FunName: "GetPubKeyY",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetPubKeyX= function(Path)
    {
        var msg =
        {
            FunName: "GetPubKeyX",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.GetSm2UserName= function(Path)
    {
        var msg =
        {
            FunName: "GetSm2UserName",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.Set_SM2_KeyPair= function(PriKey,PubKeyX,PubKeyY,sm2UserName,Path )
    {
        var msg =
        {
            FunName: "Set_SM2_KeyPair",
            PriKey:PriKey,
            PubKeyX:PubKeyX,
            PubKeyY:PubKeyY,
            sm2UserName:sm2UserName,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YtSign= function(SignMsg,Pin,Path)
    {
        var msg =
        {
            FunName: "YtSign",
            SignMsg:SignMsg,
            Pin:Pin,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YtSign_2= function(SignMsg,Pin,Path)
    {
        var msg =
        {
            FunName: "YtSign_2",
            SignMsg:SignMsg,
            Pin:Pin,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YtVerfiy= function(id,SignMsg,PubKeyX, PubKeyY,VerfiySign,Path)
    {
        var msg =
        {
            FunName: "YtVerfiy",
            id:id,
            SignMsg:SignMsg,
            PubKeyX:PubKeyX,
            PubKeyY:PubKeyY,
            VerfiySign:VerfiySign,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SM2_DecString= function(InString,Pin,Path)
    {
        var msg =
        {
            FunName: "SM2_DecString",
            InString:InString,
            Pin:Pin,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SM2_EncString= function(InString,Path)
    {
        var msg =
        {
            FunName: "SM2_EncString",
            InString:InString,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.YtSetPin= function(OldPin,NewPin,Path)
    {
        var msg =
        {
            FunName: "YtSetPin",
            OldPin:OldPin,
            NewPin:NewPin,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.FindU= function(start)
    {
        var msg =
        {
            FunName: "FindU",
            start: start
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.FindU_2= function(start,in_data,verf_data)
    {
        var msg =
        {
            FunName: "FindU_2",
            start: start,
            in_data: in_data,
            verf_data:verf_data
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.FindU_3= function(start,in_data,verf_data)
    {
        var msg =
        {
            FunName: "FindU_3",
            start: start,
            in_data: in_data,
            verf_data:verf_data
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.IsUReadOnly= function(Path)
    {
        var msg =
        {
            FunName: "IsUReadOnly",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetUReadOnly= function(Path)
    {
        var msg =
        {
            FunName: "SetUReadOnly",
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.SetHidOnly= function(IsHidOnly,Path)
    {
        var msg =
        {
            FunName: "SetHidOnly",
            IsHidOnly:IsHidOnly,
            Path:Path
        };
        this.Socket_UK.send(JSON.stringify(msg));
    };
    this.ResetOrder = function()
    {
         var msg =
        {
            FunName: "ResetOrder"
        };
         this.Socket_UK.send(JSON.stringify(msg));
     }
    this.ContinueOrder = function()
    {
         var msg =
        {
            FunName: "ContinueOrder"
        };
         this.Socket_UK.send(JSON.stringify(msg));
     }
}
public/js/ukey.js
New file
@@ -0,0 +1,99 @@
var bConnect=0;
function load()
{
    //如果是IE10及以下浏览器,则跳过不处理
    if(navigator.userAgent.indexOf("MSIE")>0 && !navigator.userAgent.indexOf("opera") > -1) return;
    try
    {
        var s_pnp=new SoftKey3W();//创建UK类
         s_pnp.Socket_UK.onopen = function()
        {
               bConnect=1;//代表已经连接,用于判断是否安装了客户端服务
        }
        //在使用事件插拨时,注意,一定不要关掉Sockey,否则无法监测事件插拨
        s_pnp.Socket_UK.onmessage =function got_packet(Msg)
        {
            var PnpData = JSON.parse(Msg.data);
            if(PnpData.type=="PnpEvent")//如果是插拨事件处理消息
            {
                if(PnpData.IsIn)
                {
                        alert("UKEY已被插入,被插入的锁的路径是:"+PnpData.DevicePath);
                }
                else
                {
                        alert("UKEY已被拨出,被拨出的锁的路径是:"+PnpData.DevicePath);
                }
            }
        }
        s_pnp.Socket_UK.onclose = function()
        {
        }
   }
   catch(e)
   {
        alert(e.name + ": " + e.message);
        return false;
   }
}
var digitArray = new Array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f');
function toHex(n) {
        var result = ''
        var start = true;
        for ( var i=32; i>0; ) {
                i -= 4;
                var digit = ( n >> i ) & 0xf;
                if (!start || digit != 0) {
                        start = false;
                        result += digitArray[digit];
                }
        }
        return ( result == '' ? '0' : result );
}
function  HexToInt(s)
{
    var  hexch = new Array( "0", "1", "2", "3", "4", "5", "6", "7",
                                   "8", "9", "A", "B", "C", "D", "E", "F");
    s = s.toUpperCase();
    var i, j;
    var r, n, k;
    var ch;
    k = 1; r = 0;
    for (i = s.length; i > 0; i--)
    {
        ch = s.substring(i - 1, i-1+1);
        n = 0;
        for (j = 0; j < 16; j++)
            if (ch == hexch[j])
                n = j;
        r += (n * k);
        k *= 16;
    }
    return r;
}
function SnToProduceDate(InSn)
{
    var OutString='';
    OutString = (2000 + HexToInt(InSn.substring(0, 2))) + "年";
    OutString = OutString + (HexToInt(InSn.substring(2, 4))) + "月";
    OutString = OutString + (HexToInt(InSn.substring(4, 6))) + "日";
    OutString = OutString + (HexToInt(InSn.substring( 6, 8))) + "时";
    OutString = OutString + (HexToInt(InSn.substring( 8, 10))) + "分";
    OutString = OutString + (HexToInt(InSn.substring( 10, 12))) + "秒--";
    OutString = OutString + "序号:" + (HexToInt(InSn.substring(12, 16)));
    return OutString;
}
src/App.vue
@@ -1,28 +1,431 @@
<template>
  <div id="app">
    <img alt="Vue logo" src="./assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
    <div class="card-container">
      <el-card>
        <div slot="header" class="clearfix">
          <span>UKey信息</span>
          <el-button @click="getSM2PubKey" style="float: right; padding: 3px 0" type="text">刷新</el-button>
        </div>
        <div class="card-content">
          <div class="card-item">
            <el-input placeholder="请插入ukey,获取uKey的ID" v-model="uKey.id" :disabled="true">
              <template slot="prepend">UKey Id</template>
            </el-input>
          </div>
          <div class="card-item">
            <el-input placeholder="请输入内容" v-model="uKey.x">
              <template slot="prepend">PublicX</template>
            </el-input>
          </div>
          <div class="card-item">
            <el-input placeholder="请输入内容" v-model="uKey.y">
              <template slot="prepend">PublicY</template>
            </el-input>
          </div>
        </div>
          <div class="card-footer">
<!--              <el-button @click="starGenKeyPair" type="primary">更新为<span class="f-weight">(平台)</span>密钥对</el-button>-->
<!--              <el-button @click="updateDev" type="primary">更新为<span class="f-weight">(设备)</span>密钥对</el-button>-->
<!--              <el-button @click="showOwnDialog" type="primary">自定义密钥对</el-button>-->
              <el-button type="primary" icon="el-icon-edit" @click="setOwnKey">写入密钥</el-button>
              <el-button type="success" @click="getSM2PubKey" icon="el-icon-refresh">刷新</el-button>
          </div>
      </el-card>
    </div>
      <el-dialog
        title="自定义密钥对"
        width="auto"
        :visible.sync="ownKeyDialog"
        :close-on-click-modal="false"
        top="0"
        class="dialog-center"
        :modal-append-to-body="false">
        <div class="params-container">
            <div class="card-content">
                <div class="card-item">
                    <el-input placeholder="请输入内容" v-model="ownKey.pId">
                        <template slot="prepend"> 私 钥 </template>
                    </el-input>
                </div>
                <div class="card-item">
                    <el-input placeholder="请输入内容" v-model="ownKey.name">
                        <template slot="prepend">用户身份</template>
                    </el-input>
                </div>
                <div class="card-item">
                    <el-input placeholder="请输入内容" v-model="ownKey.x">
                        <template slot="prepend">PublicX</template>
                    </el-input>
                </div>
                <div class="card-item">
                    <el-input placeholder="请输入内容" v-model="ownKey.y">
                        <template slot="prepend">PublicY</template>
                    </el-input>
                </div>
            </div>
            <div class="dialog-footer">
                <el-button type="primary" @click="setOwnKey">确定</el-button>
                <el-button type="danger" @click="closeOwnDialog">取消</el-button>
            </div>
        </div>
      </el-dialog>
  </div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
import SoftKey3W from "./assets/js/Syunew3";
export default {
  name: 'App',
  components: {
    HelloWorld
  data() {
    return {
      isIn: false,
      bConnect: 0,
      uKey: {
        id: "",
        x: "",
        y: ""
      },
      ownKey: {
        pId: "",
        x: "",
        y: "",
        name: "",
      },
      ownKeyDialog: false,
    };
  },
  methods: {
    uKeyLoad() {
      //如果是IE10及以下浏览器,则跳过不处理
      if(navigator.userAgent.indexOf("MSIE")>0 && !navigator.userAgent.indexOf("opera") > -1) return false;
      try {
        let _this = this;
        let s_pnp=new SoftKey3W();//创建UK类
        _this.isIn = false;
        s_pnp.Socket_UK.onopen = function() {
          _this.bConnect = 1;   //代表已经连接,用于判断是否安装了客户端服务
          _this.initUKey();
        };
        //在使用事件插拨时,注意,一定不要关掉Sockey,否则无法监测事件插拨
        s_pnp.Socket_UK.onmessage =function got_packet(Msg) {
          let PnpData = JSON.parse(Msg.data);
          if(PnpData.type==="PnpEvent")//如果是插拨事件处理消息
          {
            if(PnpData.IsIn){
              _this.isIn = true;
              _this.bConnect = 1;
              _this.initUKey();
              _this.getSM2PubKey();
            }else{
              _this.isIn = false;
              _this.bConnect = 0;
              _this.initUKey();
            }
          }
        }
      }catch (e) {
        alert(e.name + ": " + e.message);
        return false;
      }
    },
    initUKey(){
      this.uKey.id = "";
      this.uKey.x = "";
      this.uKey.y = "";
    },
    getSM2PubKey() {
      let _this = this;
      if(this.bConnect === 0) {
        window.alert("未能连接服务程序,请确定服务程序是否安装。");
        return false;
      }
      try {
        let DevicePath;
        let s_pnp=new SoftKey3W();//创建UK类
        s_pnp.Socket_UK.onopen = function() {
          s_pnp.ResetOrder();
        };
        s_pnp.Socket_UK.onmessage = function got_packet(Msg) {
          let UK_Data = JSON.parse(Msg.data);
          if(UK_Data.type!=="Process") return false;//如果不是流程处理消息,则跳过
          switch(UK_Data.order) {
            case 0:
              s_pnp.FindPort(0);
              break;
            case 1:
              if(UK_Data.LastError!==0){
                window.alert ("未发现加密锁,请插入加密锁");
                s_pnp.Socket_UK.close();
                return false;
              }
              DevicePath = UK_Data.return_value;
              s_pnp.GetChipID(DevicePath)
              break;
            case 2:
              if(UK_Data.LastError!==0){
                window.alert ("未发现加密锁,请插入加密锁");
                s_pnp.Socket_UK.close();
                return false;
              }
              _this.uKey.id = UK_Data.return_value;
              s_pnp.GetPubKeyX(DevicePath);
              break;
            case 3:
              if(UK_Data.LastError!==0){
                window.alert ("获取用公钥X失败");
                s_pnp.Socket_UK.close();
                return false;
              }
              _this.uKey.x = UK_Data.return_value;
              s_pnp.GetPubKeyY(DevicePath);
              break;
            case 4:
              if(UK_Data.LastError!==0){
                window.alert ("获取用公钥Y失败");
                s_pnp.Socket_UK.close();
                return false;
              }
              _this.uKey.y = UK_Data.return_value;
              s_pnp.Socket_UK.close()
              break;
          }
        }
      }catch (e) {
        console.log(e);
      }
    },
    starGenKeyPair() {
      let _this = this;
      if(this.bConnect === 0) {
        window.alert("未能连接服务程序,请确定服务程序是否安装。");
        return false;
      }
      try {
        let DevicePath, PrivateKey, PublicX, PublicY;
        let s_pnp=new SoftKey3W();//创建UK类
        s_pnp.Socket_UK.onopen = function() {
          s_pnp.ResetOrder()
        }
        s_pnp.Socket_UK.onmessage = function got_packet(Msg) {
          let UK_Data = JSON.parse(Msg.data);
          if(UK_Data.type!=="Process") return false;//如果不是流程处理消息,则跳过
          switch(UK_Data.order) {
            case 0:
              s_pnp.FindPort(0);
              break;
            case 1:
              if(UK_Data.LastError!==0){
                window.alert ("未发现加密锁,请插入加密锁");
                s_pnp.Socket_UK.close();
                return false;
              }
              DevicePath = UK_Data.return_value;
              s_pnp.StarGenKeyPair(DevicePath);
              break;
            case 2:
              if(UK_Data.LastError!==0){
                window.alert ("产生密钥对出现错误,错误码为:"+UK_Data.LastError.toString());
                s_pnp.Socket_UK.close();
                return false;
              }
              s_pnp.GenPriKey();
              break;
            case 3:
              if(UK_Data.LastError!==0){
                window.alert ("获取生成的私钥时错误,错误码为:"+UK_Data.LastError.toString());
                s_pnp.Socket_UK.close();
                return false;
              }
              PrivateKey = UK_Data.return_value;
              s_pnp.GenPubKeyX();
              break;
            case 4:
              if(UK_Data.LastError!==0){
                window.alert ("获取生成的公钥X时错误,错误码为:"+UK_Data.LastError.toString());
                s_pnp.Socket_UK.close();
                return false;
              }
              PublicX = UK_Data.return_value;
              s_pnp.GenPubKeyY();
              break;
            case 5:
              if(UK_Data.LastError!==0){
                window.alert ("获取生成的公钥Y时错误,错误码为:"+UK_Data.LastError.toString());
                s_pnp.Socket_UK.close();
                return false;
              }
              PublicY = UK_Data.return_value;
              var name = "武汉源畅科技有限公司";
              s_pnp.Set_SM2_KeyPair(PrivateKey, PublicX, PublicY, name, DevicePath);
              break;
            case 6:
              if(UK_Data.LastError!==0){
                window.alert ("设置密钥对及用户身份时出现错误");
                s_pnp.Socket_UK.close();
                return false;
              }
              _this.getSM2PubKey();
              s_pnp.Socket_UK.close();
              break;
          }
        }
      }catch (e) {
        console.log(e);
      }
    },
    updateDev() {
      let _this = this;
      if(this.bConnect === 0) {
        window.alert("未能连接服务程序,请确定服务程序是否安装。");
        return false;
      }
      try {
        let DevicePath;
        let s_pnp=new SoftKey3W();//创建UK类
        s_pnp.Socket_UK.onopen = function() {
          s_pnp.ResetOrder()
        }
        s_pnp.Socket_UK.onmessage = function got_packet(Msg) {
          let UK_Data = JSON.parse(Msg.data);
          if(UK_Data.type!=="Process") return false;//如果不是流程处理消息,则跳过
          switch(UK_Data.order) {
            case 0:
              s_pnp.FindPort(0);
              break;
            case 1:
              if(UK_Data.LastError!==0){
                window.alert ("未发现加密锁,请插入加密锁");
                s_pnp.Socket_UK.close();
                return false;
              }
              DevicePath = UK_Data.return_value;
              var oldTime = new Date("2023-3-3 00:00:00").getTime();
              var nowTime = (new Date()).getTime();
              var PrivateKey = "A3A96FD399FB5CD5761D1624571E4158FC8D6E896A7754D62E3EA47DC766BF9B";
              var PublicX = "129BDA6338262E3914704DB177955436A2183284CFAA69DAEB7432D591D0CF62";
              var PublicY = "EC2FC8397C31530159EF4F9223DA40D4039203AA1D49AEECDC9366973CF7AE20";
              if(nowTime<oldTime) {
                PrivateKey = "C1B18CCB03B1DEEDEE9DEDB95C456F55CA24CD0C478ACCFBE57371BA4A7E2883";
                PublicX = "FE7C0F1805BA9F263BCE6EB198DE02B52C6706AF5C9FBC24C8B0E19545B01595";
                PublicY = "6471C138A584BD6EEAFE1FCD7628531A7DE8E49FFD205857AE1F82D84016F3F3";
              }
              s_pnp.Set_SM2_KeyPair(PrivateKey, PublicX, PublicY, "123", DevicePath);
              break;
            case 2:
              if(UK_Data.LastError!==0){
                window.alert ("设置密钥对及用户身份时出现错误");
                s_pnp.Socket_UK.close();
                return false;
              }
              _this.getSM2PubKey();
              s_pnp.Socket_UK.close();
              break
          }
        }
      }catch(e) {
        console.log(e);
      }
    },
    showOwnDialog() {
      this.ownKeyDialog = true;
    },
    setOwnKey() {
      let _this = this;
      if(this.bConnect === 0) {
        window.alert("未能连接服务程序,请确定服务程序是否安装。");
        return false;
      }
      try {
        let DevicePath;
        let s_pnp=new SoftKey3W();//创建UK类
        s_pnp.Socket_UK.onopen = function() {
          s_pnp.ResetOrder()
        }
        s_pnp.Socket_UK.onmessage = function got_packet(Msg) {
          let UK_Data = JSON.parse(Msg.data);
          if(UK_Data.type!=="Process") return false;//如果不是流程处理消息,则跳过
          switch(UK_Data.order) {
            case 0:
              s_pnp.FindPort(0);
              break;
            case 1:
              if(UK_Data.LastError!==0){
                window.alert ("未发现加密锁,请插入加密锁");
                s_pnp.Socket_UK.close();
                return false;
              }
              DevicePath = UK_Data.return_value;
              var PrivateKey = "A3A96FD399FB5CD5761D1624571E4158FC8D6E896A7754D62E3EA47DC766BF9B";
              var PublicX = _this.uKey.x.trim();
              var PublicY = _this.uKey.y.trim();
              var name = "123";
              s_pnp.Set_SM2_KeyPair(PrivateKey, PublicX, PublicY, name, DevicePath);
              break;
            case 2:
              if(UK_Data.LastError!==0){
                window.alert ("设置密钥对及用户身份时出现错误");
                s_pnp.Socket_UK.close();
                return false;
              }
              _this.closeOwnDialog()
              s_pnp.Socket_UK.close();
              break
          }
        }
      }catch(e) {
        console.log(e);
      }
    },
    closeOwnDialog(){
      this.ownKeyDialog = false;
      if(this.isIn) {
        this.getSM2PubKey();
      }
    }
  },
  mounted() {
    this.uKeyLoad();
  }
}
</script>
<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
.card-container {
    position: absolute;
    width: 800px;
    top: 100px;
    left: 50%;
    margin-left: -400px;
}
.card-item {
    margin-bottom: 16px;
}
.f-weight {
    font-size: 18px;
    font-weight: bold;
}
.params-container {
    width: 800px;
}
.dialog-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.dialog-center .el-dialog {
    margin-bottom: 0;
}
.dialog-center .el-dialog__header {
    text-align: left;
}
.dialog-footer {
    text-align: right;
}
.card-footer {
    text-align: right;
}
</style>
src/assets/js/Syunew3.js
New file
@@ -0,0 +1,715 @@
function SoftKey3W()
{
var isIE11 = navigator.userAgent.indexOf('Trident') > -1 && navigator.userAgent.indexOf("rv:11.0") > -1;
var isEDGE= navigator.userAgent.indexOf("Edge") > -1;
var u = document.URL;
var url;
if (u.substring(0, 5) == "https") {
if(isIE11 || isEDGE)
{
url = "wss://127.0.0.1:4006/xxx";
}
else
{
url = "wss://localhost:4006/xxx";
}
} else {
url = "ws://127.0.0.1:4006/xxx";
}
var MozWebSocket;
if (typeof MozWebSocket != "undefined") {
this.Socket_UK = new MozWebSocket(url,"usbkey-protocol");
} else {
this.Socket_UK = new WebSocket(url,"usbkey-protocol");
}
this.FindPort = function(start)
{
var msg =
{
FunName: "FindPort",
start: start
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.FindPort_2 = function(start, in_data , verf_data)
{
var msg =
{
FunName: "FindPort_2",
start: start,
in_data: in_data,
verf_data:verf_data
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.FindPort_3= function(start,in_data,verf_data)
{
var msg =
{
FunName: "FindPort_3",
start: start,
in_data: in_data,
verf_data:verf_data
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetVersion= function(Path)
{
var msg =
{
FunName: "GetVersion",
Path: Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetVersionEx= function(Path)
{
var msg =
{
FunName: "GetVersionEx",
Path: Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetID_1= function(Path)
{
var msg =
{
FunName: "GetID_1",
Path: Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetID_2= function(Path)
{
var msg =
{
FunName: "GetID_2",
Path: Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.sRead= function(Path)
{
var msg =
{
FunName: "sRead",
Path: Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.sWrite = function(InData, Path)
{
var msg =
{
FunName: "sWrite",
InData: InData,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.sWrite_2= function(InData, Path)
{
var msg =
{
FunName: "sWrite_2",
InData: InData,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.sWrite_2Ex= function(InData,Path)
{
var msg =
{
FunName: "sWrite_2Ex",
InData: InData,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.sWriteEx= function(InData,Path)
{
var msg =
{
FunName: "sWriteEx",
InData: InData,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.sWriteEx_New= function(InData,Path)
{
var msg =
{
FunName: "sWriteEx_New",
InData: InData,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.sWrite_2Ex_New= function(InData,Path)
{
var msg =
{
FunName: "sWrite_2Ex_New",
InData: InData,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetCal= function(Hkey,Lkey,new_Hkey,new_Lkey,Path)
{
var msg =
{
FunName: "SetCal",
Hkey:   Hkey,
Lkey:   Lkey,
new_Hkey:new_Hkey,
new_Lkey:new_Lkey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetBuf= function(InData,pos)
{
var msg =
{
FunName: "SetBuf",
InData: InData,
pos:pos
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetBuf= function(pos)
{
var msg =
{
FunName: "GetBuf",
pos: pos
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YRead= function(Address,HKey,LKey,Path)
{
var msg =
{
FunName: "YRead",
Address:Address,
HKey:HKey,
LKey:LKey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YWrite= function(InData,Address,HKey,LKey,Path)
{
var msg =
{
FunName: "YWrite",
InData:InData,
Address:Address,
HKey:HKey,
LKey:LKey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YReadEx= function(Address,len, HKey,LKey,Path)
{
var msg =
{
FunName: "YReadEx",
Address:Address,
len:len,
HKey:HKey,
LKey:LKey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YWriteEx= function(Address,len,HKey,LKey,Path)
{
var msg =
{
FunName: "YWriteEx",
Address:Address,
len:len,
HKey:HKey,
LKey:LKey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YReadString= function(Address,len,HKey,LKey,Path)
{
var msg =
{
FunName: "YReadString",
Address:Address,
len:len,
HKey:HKey,
LKey:LKey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YWriteString= function(InString,Address,HKey,LKey,Path)
{
var msg =
{
FunName: "YWriteString",
InString:InString,
Address:Address,
HKey:HKey,
LKey:LKey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetWritePassword= function(W_Hkey,W_Lkey,new_Hkey,new_Lkey,Path)
{
var msg =
{
FunName: "SetWritePassword",
W_Hkey:W_Hkey,
W_Lkey:W_Lkey,
new_Hkey:new_Hkey,
new_Lkey:new_Lkey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetReadPassword= function(W_Hkey,W_Lkey,new_Hkey,new_Lkey,Path)
{
var msg =
{
FunName: "SetReadPassword",
W_Hkey:W_Hkey,
W_Lkey:W_Lkey,
new_Hkey:new_Hkey,
new_Lkey:new_Lkey,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.DecString= function(InString,Key)
{
var msg =
{
FunName: "DecString",
InString:InString,
Key:Key
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.EncString= function(InString,Path)
{
var msg =
{
FunName: "EncString",
InString:InString,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.EncString_New= function(InString,Path)
{
var msg =
{
FunName: "EncString_New",
InString:InString,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.Cal= function(Path)
{
var msg =
{
FunName: "Cal",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.Cal_New= function(Path)
{
var msg =
{
FunName: "Cal_New",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetCal_2= function(Key,Path)
{
var msg =
{
FunName: "SetCal_2",
Key:Key,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetCal_New= function(Key,Path)
{
var msg =
{
FunName: "SetCal_New",
Key:Key,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetEncBuf= function(InData,pos)
{
var msg =
{
FunName: "SetEncBuf",
InData:InData,
pos: pos
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetEncBuf= function(pos)
{
var msg =
{
FunName: "GetEncBuf",
pos: pos
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.ReSet= function(Path)
{
var msg =
{
FunName: "ReSet",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetID= function(Seed,Path)
{
var msg =
{
FunName: "SetID",
Seed:Seed,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetProduceDate= function(Path)
{
var msg =
{
FunName: "GetProduceDate",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.MacAddr= function()
{
var msg =
{
FunName: "MacAddr"
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetChipID= function(Path)
{
var msg =
{
FunName: "GetChipID",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.StarGenKeyPair= function(Path)
{
var msg =
{
FunName: "StarGenKeyPair",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GenPubKeyY= function()
{
var msg =
{
FunName: "GenPubKeyY"
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GenPubKeyX= function()
{
var msg =
{
FunName: "GenPubKeyX"
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GenPriKey= function()
{
var msg =
{
FunName: "GenPriKey"
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetPubKeyY= function(Path)
{
var msg =
{
FunName: "GetPubKeyY",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetPubKeyX= function(Path)
{
var msg =
{
FunName: "GetPubKeyX",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.GetSm2UserName= function(Path)
{
var msg =
{
FunName: "GetSm2UserName",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.Set_SM2_KeyPair= function(PriKey,PubKeyX,PubKeyY,sm2UserName,Path )
{
var msg =
{
FunName: "Set_SM2_KeyPair",
PriKey:PriKey,
PubKeyX:PubKeyX,
PubKeyY:PubKeyY,
sm2UserName:sm2UserName,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YtSign= function(SignMsg,Pin,Path)
{
var msg =
{
FunName: "YtSign",
SignMsg:SignMsg,
Pin:Pin,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YtSign_2= function(SignMsg,Pin,Path)
{
var msg =
{
FunName: "YtSign_2",
SignMsg:SignMsg,
Pin:Pin,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YtVerfiy= function(id,SignMsg,PubKeyX, PubKeyY,VerfiySign,Path)
{
var msg =
{
FunName: "YtVerfiy",
id:id,
SignMsg:SignMsg,
PubKeyX:PubKeyX,
PubKeyY:PubKeyY,
VerfiySign:VerfiySign,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SM2_DecString= function(InString,Pin,Path)
{
var msg =
{
FunName: "SM2_DecString",
InString:InString,
Pin:Pin,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SM2_EncString= function(InString,Path)
{
var msg =
{
FunName: "SM2_EncString",
InString:InString,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.YtSetPin= function(OldPin,NewPin,Path)
{
var msg =
{
FunName: "YtSetPin",
OldPin:OldPin,
NewPin:NewPin,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.FindU= function(start)
{
var msg =
{
FunName: "FindU",
start: start
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.FindU_2= function(start,in_data,verf_data)
{
var msg =
{
FunName: "FindU_2",
start: start,
in_data: in_data,
verf_data:verf_data
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.FindU_3= function(start,in_data,verf_data)
{
var msg =
{
FunName: "FindU_3",
start: start,
in_data: in_data,
verf_data:verf_data
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.IsUReadOnly= function(Path)
{
var msg =
{
FunName: "IsUReadOnly",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetUReadOnly= function(Path)
{
var msg =
{
FunName: "SetUReadOnly",
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.SetHidOnly= function(IsHidOnly,Path)
{
var msg =
{
FunName: "SetHidOnly",
IsHidOnly:IsHidOnly,
Path:Path
};
this.Socket_UK.send(JSON.stringify(msg));
};
this.ResetOrder = function()
{
var msg =
{
FunName: "ResetOrder"
};
this.Socket_UK.send(JSON.stringify(msg));
}
this.ContinueOrder = function()
{
var msg =
{
FunName: "ContinueOrder"
};
this.Socket_UK.send(JSON.stringify(msg));
}
}
export default SoftKey3W;
src/assets/js/common.js
New file
@@ -0,0 +1,5 @@
import SoftKey3W from './Syunew3'
export {
    SoftKey3W
}
src/main.js
@@ -1,8 +1,12 @@
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App.vue'
Vue.config.productionTip = false
Vue.use(ElementUI)
new Vue({
  render: h => h(App),
    render: h => h(App),
}).$mount('#app')
vue.config.js
New file
@@ -0,0 +1,4 @@
// vue.config.js
module.exports = {
    publicPath: './'
}