├── .gitignore ├── README.md ├── babel.config.js ├── npm ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── index.html └── js │ └── qqmap.js ├── src ├── App.vue ├── assets │ └── img │ │ ├── bg.png │ │ ├── ico.png │ │ └── no_card.png ├── main.js ├── router │ └── index.js ├── service │ ├── base.js │ └── http.js ├── static │ ├── .gitkeep │ ├── js │ │ ├── filter.js │ │ ├── jsencrypt.min.js │ │ ├── qqmap.js │ │ └── utils.js │ └── style │ │ ├── global.scss │ │ ├── mix.scss │ │ └── nomal.css ├── store │ ├── index.js │ └── modules │ │ └── demo.js └── views │ ├── demo │ ├── detail │ │ └── index.vue │ ├── index.vue │ └── route.js │ ├── home │ ├── index.vue │ └── route.js │ └── layout │ └── index.vue ├── vue.config.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw* 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 概述 2 | 3 | * 基础环境: 4 | 5 | - [Node.js最新稳定版](https://nodejs.org/en/) 6 | 7 | - [Vue2.x](https://cn.vuejs.org/v2/guide/installation.html) 8 | 9 | - [VueCli3](https://cli.vuejs.org/) 10 | 11 | * 开发:跟普通的移动端单页开发方式一致。 12 | - 通过npm安装sass依赖可能会报错;建议通过yarn安装, 13 | ```yarn install``` 14 | 15 | * 调试: 16 | 17 | - 开发环境下,可以借助chrome进行调试,需要注意的是,要手动在sessionStorage中注入 **wx_info** 验证,具体的wx_info配置可以询问后端开发人员 18 | 19 | - 如果要进行真实账号测试或者是生产环境下,可以通过微信开发者工具进行调试,调试方式跟chrome类似。 20 | 21 | - vuex的调试,请先科学上网,然后在chrome拓展工具里搜索安装 **Vue.js devtools** ,安装完成后打开开发者工具,在最右侧vue栏里进行vuex调试。 22 | 23 | 24 | ## 具体使用 25 | 26 | ### 路由管理 27 | 28 | * 采用树形结构管理路由,参考 HOME_ROUTERS 和 总路由 index.js的关系 29 | 30 | * 每一个大模块单独设置一个路由,再汇总到总路由文件 31 | 32 | * 如果该模块较为复杂,页面很多,可以视情况再细分路由。 33 | 34 | * 结合 Vue 的异步组件和 Webpack 的代码分割功能,实现路由组件的懒加载 35 | 36 | ### serve管理 37 | 38 | * serve 下的 base.js用于全局配置api请求的域名或者ip地址等 39 | 40 | 可以快速的切换测试环境和生产环境 41 | 42 | (mock为等在接口开发时使用的mock环境) 43 | 44 | * serve下的 http.js 用于封装axios 45 | 46 | 如果是微信公众号的项目,在此处配置token获取方式,并且添加到请求头 47 | 48 | ### 数据管理 49 | 50 | * 简单项目无需使用vuex 51 | 52 | * 数据交互较多难以管理时,使用vuex提高效率 53 | 54 | 按照 store 下的示例modules进行编写 55 | 56 | * 已经集成了vuex数据持久化插件,默认为所有state数据都存入session 57 | 58 | 如果要更改存储位置,或者局部存入,自行修改plugin配置 59 | 60 | ### 自适应方案(rem+vw) 61 | 62 | * 在static/style/global下配置 63 | 64 | * 默认配置以750作为设计稿基准 65 | 66 | * 同时可以配置最大最小适配范围 67 | 68 | 69 | ### 上述功能都集成在view/demo项目里,可以参考demo具体了解 70 | 71 | 72 | ## 开发优化 73 | 74 | * alias:在vue.config查看alias 路径,自行添加或者修改 75 | 76 | * mixins: 已经全局配置,在static 下的mixin 进行样式函数的编写 77 | 78 | ## 用户体验 79 | 80 | * 使用路由懒加载,提高加载速度 81 | 82 | * 全局动态配置了路由切换动画,为了正确显示切换动画,在配置路由时一定要写明路由层级,切换动画时会根据层级比较作为判断 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /npm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lv7202215/vue_m_cli/1f51156e74ea4b88c3e64243e7901aa90f5589b5/npm -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DF_M_CLI", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "@babel/plugin-syntax-dynamic-import": "^7.2.0", 12 | "@nutui/nutui": "^2.1.0", 13 | "axios": "^0.18.0", 14 | "jsencrypt": "^3.0.0-rc.1", 15 | "style-resources-loader": "^1.2.1", 16 | "vue": "^2.6.10", 17 | "vue-router": "^3.0.4", 18 | "vuex": "^3.1.0", 19 | "vuex-persistedstate": "^2.5.4" 20 | }, 21 | "devDependencies": { 22 | "@vue/cli-plugin-babel": "^3.1.1", 23 | "@vue/cli-plugin-eslint": "^3.1.1", 24 | "@vue/cli-service": "^3.1.1", 25 | "babel-eslint": "^10.0.1", 26 | "babel-plugin-component": "^1.1.1", 27 | "eslint": "^5.8.0", 28 | "eslint-plugin-vue": "^5.0.0-0", 29 | "node-sass": "^4.9.0", 30 | "sass-loader": "^7.0.1", 31 | "vue-template-compiler": "^2.6.10" 32 | }, 33 | "eslintConfig": { 34 | "root": true, 35 | "env": { 36 | "node": true 37 | }, 38 | "extends": [ 39 | "plugin:vue/essential" 40 | ], 41 | "rules": { 42 | "rrow-parens": 0, 43 | "generator-star-spacing": 0, 44 | "no-debugger": 0, 45 | "vue/no-parsing-error": [ 46 | 2, 47 | { 48 | "x-invalid-end-tag": false 49 | } 50 | ], 51 | "semi": [ 52 | "off", 53 | "always" 54 | ], 55 | "indent": 0 56 | }, 57 | "parserOptions": { 58 | "parser": "babel-eslint" 59 | } 60 | }, 61 | "browserslist": [ 62 | "> 1%", 63 | "last 2 versions", 64 | "not ie <= 8" 65 | ] 66 | } 67 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lv7202215/vue_m_cli/1f51156e74ea4b88c3e64243e7901aa90f5589b5/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | DF_M_CLI 10 | 11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /public/js/qqmap.js: -------------------------------------------------------------------------------- 1 | window.qq=window.qq||{},qq.maps=qq.maps||{},window.soso||(window.soso=qq),soso.maps||(soso.maps=qq.maps),qq.maps.Geolocation=function(){"use strict";var e=[],t=null,o=0,n="_geoIframe_"+Math.ceil(1e7*Math.random()),i=document.createElement("iframe"),r=null,s=null,a=null,c=null,u=function(u,p){if(!u)return void alert("请输入key!");if(!p)return void alert("请输入referer!");var l=document.getElementById(n);if(!l){i.setAttribute("id",n);var g="https:";i.setAttribute("src",g+"//apis.map.qq.com/tools/geolocation?key="+u+"&referer="+p),i.setAttribute("style","display: none; width: 100%; height: 30%"),document.body?document.body.appendChild(i):document.write(i.outerHTML);var m=this;window.addEventListener("message",function(n){var i=n.data;if(i&&"geolocation"==i.module){if(clearTimeout(c),e.length>0){var u=e.shift();u.sucCb&&u.sucCb(i)}o=2,m.executeNextGeo(),t&&t(i)}else{s=(new Date).getTime();var p=s-r;if(p>=a){if(e.length>0&&"geo"===e[0].type){var u=e.shift(),l={type:"fail",code:5,message:"The request"};u.errCb&&u.errCb(l)}clearTimeout(c),o=-1,m.executeNextGeo()}if(e.length>0&&"ip"===e[0].type){var u=e.shift();u.errCb&&u.errCb(l)}}},!1)}};return u.prototype.executeNextGeo=function(){1!==o&&e.length>0&&(o=1,e[0].geoprocess())},u.prototype.getLocation=function(t,n,i){if(i&&i.timeout){var r=new RegExp("^[0-9]*$");if(!r.test(i.timeout))return void alert("timeout 请输入数字")}if(e.length>10)throw new Error("geolocation queue must be lass than 10");e.push({sucCb:t,errCb:n,option:i,geoprocess:this.getOnceLocation,type:"geo"}),1!==o&&(o=1,this.getOnceLocation())},u.prototype.getOnceLocation=function(){var t=e[0]&&e[0].option;r=(new Date).getTime(),a=t&&t.timeout?+t.timeout:1e4,clearTimeout(c),c=setTimeout(function(){if(e.length>0){var t=e.shift();t.errCb&&t.errCb()}},a),document.getElementById(n).contentWindow.postMessage("getLocation","*")},u.prototype.getIpLocation=function(t,n){if(e.length>10)throw new Error("geolocation queue mast be lass than 10");e.push({sucCb:t,errCb:n,geoprocess:this.getOnceIpLocation,type:"ip"}),1!==o&&(o=1,this.getOnceIpLocation())},u.prototype.getOnceIpLocation=function(){document.getElementById(n).contentWindow.postMessage("getLocation.robust","*")},u.prototype.watchPosition=function(e){t=e,document.getElementById(n).contentWindow.postMessage("watchPosition","*")},u.prototype.clearWatch=function(){t=null,document.getElementById(n).contentWindow.postMessage("clearWatch","*")},u}(); 2 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 30 | 31 | 40 | -------------------------------------------------------------------------------- /src/assets/img/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lv7202215/vue_m_cli/1f51156e74ea4b88c3e64243e7901aa90f5589b5/src/assets/img/bg.png -------------------------------------------------------------------------------- /src/assets/img/ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lv7202215/vue_m_cli/1f51156e74ea4b88c3e64243e7901aa90f5589b5/src/assets/img/ico.png -------------------------------------------------------------------------------- /src/assets/img/no_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lv7202215/vue_m_cli/1f51156e74ea4b88c3e64243e7901aa90f5589b5/src/assets/img/no_card.png -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router/index' 4 | import store from './store/index' 5 | import utils from './static/js/utils' 6 | import {JSEncrypt} from 'jsencrypt' 7 | import NutUI from '@nutui/nutui'; 8 | import '@nutui/nutui/dist/nutui.css'; 9 | NutUI.install(Vue) 10 | import http from '@/service/http' 11 | import './static/style/nomal.css'// 初始化样式 12 | const plugins = [utils]; // 插件列表 13 | plugins.map(plg => Vue.use(plg)); // 引入插件 14 | Vue.config.productionTip = false 15 | Object.assign(Vue.prototype,{$http:http}); 16 | 17 | // /* RSA加密 */ 18 | // Vue.prototype.$setRSA = (password, publicKey) =>{ 19 | // let encrypt = new JSEncrypt() 20 | // encrypt.setPublicKey(publicKey) 21 | // return encrypt.encrypt(password) 22 | // } 23 | // Vue.prototype.$getRSA = (rsa ,priKey)=>{ 24 | // let decrypt = new JSEncrypt() 25 | // decrypt.setPrivateKey(priKey) 26 | // return decrypt.decrypt(rsa) 27 | // } 28 | new Vue({ 29 | router, 30 | store, 31 | render: h => h(App) 32 | }).$mount('#app') 33 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | const Index = () => import( '@views/layout/index'); 4 | import HOME_ROUTERS from '../views/home/route' 5 | import DEMO_ROUTERS from '../views/demo/route' 6 | 7 | Vue.use(Router) 8 | 9 | const router = new Router({ 10 | routes: [ 11 | { 12 | path: '/', 13 | name: '首页', 14 | component: Index, 15 | redirect: 'home', 16 | children: [ 17 | ...HOME_ROUTERS, 18 | ...DEMO_ROUTERS 19 | ], 20 | meta: { 21 | index:0, // 层级,用于判断过渡动画的效果 22 | requireAuth: false // 添加该字段,表示进入这个路由是需要登录的 23 | } 24 | } 25 | ] 26 | }) 27 | 28 | router.beforeEach(function (to, from, next) { 29 | if (to.meta.title) { // || store.state.title 30 | Vue.refreshTitle(to.meta.title ); //|| store.state.title 31 | } 32 | next(); 33 | }); 34 | 35 | export default router -------------------------------------------------------------------------------- /src/service/base.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 接口域名的管理 3 | * create by lvzhiyang 4 | */ 5 | const base = { 6 | dv:'http://192.168.1.66:8081', // 测试环境 7 | pr: '', // 生产环境 8 | mock:' https://easy-mock.com/mock/5cb4762ae14be30f81aee1a6/mock' // mock环境 9 | } 10 | export default base; 11 | -------------------------------------------------------------------------------- /src/service/http.js: -------------------------------------------------------------------------------- 1 | /** 2 | * axios封装 3 | * 请求拦截、响应拦截、错误统一处理 4 | * create by lvzhiyang 5 | */ 6 | import axios from 'axios'; 7 | import store from '../store/index'; 8 | import router from '../router/index' 9 | import base from './base' 10 | 11 | 12 | // 创建axios实例 13 | axios.defaults.baseURL = base.mock; // 后端api开发完成改成对应的dv 14 | axios.defaults.timeout = 15000; 15 | 16 | // 设置post请求头 17 | axios.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'; 18 | 19 | // 从wx_info获取token 20 | let token= sessionStorage.getItem('token') 21 | if(token) axios.defaults.headers.common["token"] = token; 22 | 23 | /** 24 | * 请求拦截器 25 | */ 26 | axios.interceptors.request.use( 27 | config => { 28 | store.state.loading = true; 29 | return config 30 | }, 31 | error => { 32 | setTimeout(() => { 33 | store.state.loading = false; 34 | }, 3000) 35 | return Promise.reject(error) 36 | }) 37 | /** 38 | * 响应拦截器 39 | */ 40 | axios.interceptors.response.use( 41 | data => { 42 | // 错误处理 43 | switch (data.data.result) { 44 | // 401: 未登录状态,跳转登录页 45 | case 401: 46 | break; 47 | // 403 token过期 48 | // 清除token并跳转登录页 49 | case 403: 50 | console.log('登录过期,请重新登录'); 51 | break; 52 | // 404请求不存在 53 | case 404: 54 | this.$router.push({path:'/404'}) 55 | break; 56 | default: 57 | } 58 | // 响应成功关闭loading 59 | store.state.loading = false; 60 | return data 61 | }, 62 | error => { 63 | setTimeout(() => { 64 | store.state.loading = false; 65 | }, 1000) 66 | return Promise.reject(error) 67 | }) 68 | 69 | export default { 70 | get(url, params) { 71 | return new Promise((resolve, reject) => { 72 | axios({ 73 | method: 'get', 74 | url: url, 75 | params: params 76 | 77 | }).then(res => { 78 | // console.log(res); 79 | if (res.data.errCode !== 0) this.$toast.fail(res.data.errMsg); 80 | else resolve(res.data); 81 | }, err => { 82 | reject(err); 83 | this.$toast.fail(err.message); 84 | }); 85 | }); 86 | }, 87 | post(url, params) { 88 | return new Promise((resolve, reject) => { 89 | axios({ 90 | method: 'post', 91 | url: url, 92 | data: params 93 | }).then(res => { 94 | if (res.data.errCode !== 0) this.$toast.fail(res.data.errMsg); 95 | else resolve(res.data) 96 | }, err => { 97 | reject(err); 98 | this.$toast.fail(err.message); 99 | }) 100 | }) 101 | }, 102 | } 103 | 104 | -------------------------------------------------------------------------------- /src/static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lv7202215/vue_m_cli/1f51156e74ea4b88c3e64243e7901aa90f5589b5/src/static/.gitkeep -------------------------------------------------------------------------------- /src/static/js/filter.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | // 大于99的数字变成99+ 3 | Vue.filter('numthumbnail', function (value) { 4 | if (value > 99) { 5 | value = '99+'; 6 | } 7 | return value; 8 | }) 9 | // 将数量进行千分转换过滤器 10 | Vue.filter('millesimal', function (value) { 11 | if (value > 999) { 12 | value = value / 1000; 13 | value = value.toFixed(1) + 'k'; 14 | } 15 | return value; 16 | }); 17 | // 金钱的保留两位小数,3位隔开,加“¥”过滤器 18 | Vue.filter('money', function (money, point) { 19 | point = point > 0 && point <= 20 ? point : 2; 20 | var isNegative = false; 21 | if (money < 0) { 22 | money = Math.abs(money); 23 | isNegative = true; 24 | } 25 | money = parseFloat((money + '').replace(/[^\d\.-]/g, '')).toFixed(point) + ''; 26 | var l = money.split('.')[0].split('').reverse(); 27 | var r = money.split('.')[1]; 28 | var result = ''; 29 | for (var i = 0; i < l.length; i++) { 30 | result += l[i] + ((i + 1) % 3 === 0 && (i + 1) !== l.length ? ',' : ''); 31 | } 32 | return '¥ ' + ((isNegative ? '-' : '') + result.split('').reverse().join('') + '.' + r); 33 | }); 34 | Vue.filter('ToFixed', function (num, point) { 35 | if (!num) { 36 | return '0.00' 37 | } else { 38 | point = point > 0 && point <= 20 ? point : 2; 39 | var isNegative = false; 40 | if (num < 0) { 41 | num = Math.abs(num); 42 | isNegative = true; 43 | } 44 | num = parseFloat((num + '').replace(/[^\d\.-]/g, '')).toFixed(point) + ''; 45 | var l = num.split('.')[0].split('').reverse(); 46 | var r = num.split('.')[1]; 47 | var result = ''; 48 | for (var i = 0; i < l.length; i++) { 49 | result += l[i] + ((i + 1) % 3 === 0 && (i + 1) !== l.length ? ',' : ''); 50 | } 51 | return '' + ((isNegative ? '-' : '') + result.split('').reverse().join('') + '.' + r); 52 | } 53 | }); 54 | // 时间过滤器 年月日 55 | Vue.filter('time', function (value) { 56 | if (typeof value === 'undefined') { 57 | return ''; 58 | } 59 | var updateDate = new Date(parseInt(value.toString().replace('/Date(', '').replace(')/', ''), 10)); 60 | updateDate.format = function (format) { 61 | var o = { 62 | 'M+': this.getMonth() + 1, 63 | 'd+': this.getDate(), 64 | 'h+': this.getHours(), 65 | 'm+': this.getMinutes(), 66 | 's+': this.getSeconds(), 67 | 'q+': Math.floor((this.getMonth() + 3) / 3), 68 | 'S': this.getMilliseconds() 69 | }; 70 | if (/(y+)/i.test(format)) { 71 | format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); 72 | } 73 | for (var k in o) { 74 | if (new RegExp('(' + k + ')').test(format)) { 75 | format = format.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)); 76 | } 77 | } 78 | return format; 79 | }; 80 | return updateDate.format('yyyy-MM-dd'); 81 | }); 82 | // 时间过滤器 时分秒 83 | Vue.filter('YbTime', function (value) { 84 | if (typeof value === 'undefined') { 85 | return ''; 86 | } 87 | var updateDate = new Date(parseInt(value.toString().replace('/Date(', '').replace(')/', ''), 10)); 88 | updateDate.format = function (format) { 89 | var o = { 90 | 'M+': this.getMonth() + 1, 91 | 'd+': this.getDate(), 92 | 'h+': this.getHours(), 93 | 'm+': this.getMinutes(), 94 | 's+': this.getSeconds(), 95 | 'q+': Math.floor((this.getMonth() + 3) / 3), 96 | 'S': this.getMilliseconds() 97 | }; 98 | if (/(y+)/i.test(format)) { 99 | format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); 100 | } 101 | for (var k in o) { 102 | if (new RegExp('(' + k + ')').test(format)) { 103 | format = format.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)); 104 | } 105 | } 106 | return format; 107 | }; 108 | return updateDate.format('yyyy-MM-dd hh:mm:ss'); 109 | }); 110 | // 时间过滤器 111 | Vue.filter('dateFilter', function (value) { 112 | if (typeof value === 'undefined') { 113 | return ''; 114 | } 115 | var updateDate = new Date(parseInt(value.toString().replace('/Date(', '').replace(')/', ''), 10)); 116 | updateDate.format = function (format) { 117 | var o = { 118 | 'M+': this.getMonth() + 1, 119 | 'd+': this.getDate(), 120 | 'h+': this.getHours(), 121 | 'm+': this.getMinutes(), 122 | 's+': this.getSeconds(), 123 | 'q+': Math.floor((this.getMonth() + 3) / 3), 124 | 'S': this.getMilliseconds() 125 | }; 126 | 127 | if (/(y+)/i.test(format)) { 128 | format = format.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)); 129 | } 130 | for (var k in o) { 131 | if (new RegExp('(' + k + ')').test(format)) { 132 | format = format.replace(RegExp.$1, RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)); 133 | } 134 | } 135 | return format; 136 | }; 137 | 138 | let currentDate = new Date(); 139 | let days, hours, minutes; 140 | days = currentDate.getDate() - updateDate.getDate(); 141 | hours = currentDate.getHours() - updateDate.getHours(); 142 | minutes = currentDate.getMinutes() - updateDate.getMinutes(); 143 | if (days === 0) { 144 | if (hours === 0) { 145 | if (minutes <= 0){ 146 | return "刚刚"; 147 | } 148 | else { 149 | return minutes + "分钟前"; 150 | } 151 | } 152 | else if (hours < 12){ 153 | return hours + "小时前"; 154 | } 155 | return "今天 " + updateDate.format("hh:mm"); 156 | } 157 | else if (days === 1){ 158 | return "昨天 " + updateDate.format("hh:mm"); 159 | } 160 | else if (days === 2){ 161 | return "前天 " + updateDate.format("hh:mm"); 162 | } 163 | else { 164 | return updateDate.format("yyyy/MM/dd"); 165 | } 166 | return updateDate.format("yyyy/MM/dd hh:mm"); 167 | }) 168 | Vue.filter('distance', function (value) { 169 | if (value === null || value === undefined) { 170 | return '--' 171 | } else if (value < 1000) { 172 | return value + ' m' 173 | } else { 174 | return (value / 1000).toFixed(1) + ' km' 175 | } 176 | }); 177 | // 卡号加*** 178 | Vue.filter('bindCardNo',(value)=>{ 179 | if(value){ 180 | let arr1 = value.substr(value.length-4); 181 | let arr2 = value.substr(0,4) 182 | return arr2+' **** **** **** '+arr1 183 | } 184 | }) 185 | Vue.filter('timeFormat', function (value) { 186 | return value.replace(/:/g," : "); 187 | }) 188 | Vue.filter('money', function (value) { 189 | if (!value) return '0.00'; 190 | var intPart = Number(value).toFixed(0); 191 | var intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,'); 192 | var floatPart = '.00'; 193 | var value2Array = value.toString().split('.'); 194 | 195 | if (value2Array.length === 2) { 196 | floatPart = value2Array[1].toString(); 197 | if (floatPart.length === 1) { 198 | return intPartFormat + '.' + floatPart + '0'; 199 | } else { 200 | return intPartFormat + '.' + floatPart; 201 | } 202 | } else { 203 | return intPartFormat + floatPart; 204 | } 205 | }) 206 | 207 | -------------------------------------------------------------------------------- /src/static/js/jsencrypt.min.js: -------------------------------------------------------------------------------- 1 | /*RSA jsencrypt 2.2.0*/ 2 | var JSEncryptExports = {}; 3 | (function (exports) { 4 | function BigInteger(a, b, c) { 5 | null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b)) 6 | } 7 | 8 | function nbi() { 9 | return new BigInteger(null) 10 | } 11 | 12 | function am1(a, b, c, d, e, f) { 13 | for (; --f >= 0;) { 14 | var g = b * this[a++] + c[d] + e; 15 | e = Math.floor(g / 67108864), c[d++] = 67108863 & g 16 | } 17 | return e 18 | } 19 | 20 | function am2(a, b, c, d, e, f) { 21 | for (var g = 32767 & b, h = b >> 15; --f >= 0;) { 22 | var i = 32767 & this[a], j = this[a++] >> 15, k = h * i + j * g; 23 | i = g * i + ((32767 & k) << 15) + c[d] + (1073741823 & e), e = (i >>> 30) + (k >>> 15) + h * j + (e >>> 30), c[d++] = 1073741823 & i 24 | } 25 | return e 26 | } 27 | 28 | function am3(a, b, c, d, e, f) { 29 | for (var g = 16383 & b, h = b >> 14; --f >= 0;) { 30 | var i = 16383 & this[a], j = this[a++] >> 14, k = h * i + j * g; 31 | i = g * i + ((16383 & k) << 14) + c[d] + e, e = (i >> 28) + (k >> 14) + h * j, c[d++] = 268435455 & i 32 | } 33 | return e 34 | } 35 | 36 | function int2char(a) { 37 | return BI_RM.charAt(a) 38 | } 39 | 40 | function intAt(a, b) { 41 | var c = BI_RC[a.charCodeAt(b)]; 42 | return null == c ? -1 : c 43 | } 44 | 45 | function bnpCopyTo(a) { 46 | for (var b = this.t - 1; b >= 0; --b) a[b] = this[b]; 47 | a.t = this.t, a.s = this.s 48 | } 49 | 50 | function bnpFromInt(a) { 51 | this.t = 1, this.s = 0 > a ? -1 : 0, a > 0 ? this[0] = a : -1 > a ? this[0] = a + this.DV : this.t = 0 52 | } 53 | 54 | function nbv(a) { 55 | var b = nbi(); 56 | return b.fromInt(a), b 57 | } 58 | 59 | function bnpFromString(a, b) { 60 | var c; 61 | if (16 == b) c = 4; else if (8 == b) c = 3; else if (256 == b) c = 8; else if (2 == b) c = 1; else if (32 == b) c = 5; else { 62 | if (4 != b) return void this.fromRadix(a, b); 63 | c = 2 64 | } 65 | this.t = 0, this.s = 0; 66 | for (var d = a.length, e = !1, f = 0; --d >= 0;) { 67 | var g = 8 == c ? 255 & a[d] : intAt(a, d); 68 | 0 > g ? "-" == a.charAt(d) && (e = !0) : (e = !1, 0 == f ? this[this.t++] = g : f + c > this.DB ? (this[this.t - 1] |= (g & (1 << this.DB - f) - 1) << f, this[this.t++] = g >> this.DB - f) : this[this.t - 1] |= g << f, f += c, f >= this.DB && (f -= this.DB)) 69 | } 70 | 8 == c && 0 != (128 & a[0]) && (this.s = -1, f > 0 && (this[this.t - 1] |= (1 << this.DB - f) - 1 << f)), this.clamp(), e && BigInteger.ZERO.subTo(this, this) 71 | } 72 | 73 | function bnpClamp() { 74 | for (var a = this.s & this.DM; this.t > 0 && this[this.t - 1] == a;) --this.t 75 | } 76 | 77 | function bnToString(a) { 78 | if (this.s < 0) return "-" + this.negate().toString(a); 79 | var b; 80 | if (16 == a) b = 4; else if (8 == a) b = 3; else if (2 == a) b = 1; else if (32 == a) b = 5; else { 81 | if (4 != a) return this.toRadix(a); 82 | b = 2 83 | } 84 | var c, d = (1 << b) - 1, e = !1, f = "", g = this.t, h = this.DB - g * this.DB % b; 85 | if (g-- > 0) for (h < this.DB && (c = this[g] >> h) > 0 && (e = !0, f = int2char(c)); g >= 0;) b > h ? (c = (this[g] & (1 << h) - 1) << b - h, c |= this[--g] >> (h += this.DB - b)) : (c = this[g] >> (h -= b) & d, 0 >= h && (h += this.DB, --g)), c > 0 && (e = !0), e && (f += int2char(c)); 86 | return e ? f : "0" 87 | } 88 | 89 | function bnNegate() { 90 | var a = nbi(); 91 | return BigInteger.ZERO.subTo(this, a), a 92 | } 93 | 94 | function bnAbs() { 95 | return this.s < 0 ? this.negate() : this 96 | } 97 | 98 | function bnCompareTo(a) { 99 | var b = this.s - a.s; 100 | if (0 != b) return b; 101 | var c = this.t; 102 | if (b = c - a.t, 0 != b) return this.s < 0 ? -b : b; 103 | for (; --c >= 0;) if (0 != (b = this[c] - a[c])) return b; 104 | return 0 105 | } 106 | 107 | function nbits(a) { 108 | var b, c = 1; 109 | return 0 != (b = a >>> 16) && (a = b, c += 16), 0 != (b = a >> 8) && (a = b, c += 8), 0 != (b = a >> 4) && (a = b, c += 4), 0 != (b = a >> 2) && (a = b, c += 2), 0 != (b = a >> 1) && (a = b, c += 1), c 110 | } 111 | 112 | function bnBitLength() { 113 | return this.t <= 0 ? 0 : this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM) 114 | } 115 | 116 | function bnpDLShiftTo(a, b) { 117 | var c; 118 | for (c = this.t - 1; c >= 0; --c) b[c + a] = this[c]; 119 | for (c = a - 1; c >= 0; --c) b[c] = 0; 120 | b.t = this.t + a, b.s = this.s 121 | } 122 | 123 | function bnpDRShiftTo(a, b) { 124 | for (var c = a; c < this.t; ++c) b[c - a] = this[c]; 125 | b.t = Math.max(this.t - a, 0), b.s = this.s 126 | } 127 | 128 | function bnpLShiftTo(a, b) { 129 | var c, d = a % this.DB, e = this.DB - d, f = (1 << e) - 1, g = Math.floor(a / this.DB), 130 | h = this.s << d & this.DM; 131 | for (c = this.t - 1; c >= 0; --c) b[c + g + 1] = this[c] >> e | h, h = (this[c] & f) << d; 132 | for (c = g - 1; c >= 0; --c) b[c] = 0; 133 | b[g] = h, b.t = this.t + g + 1, b.s = this.s, b.clamp() 134 | } 135 | 136 | function bnpRShiftTo(a, b) { 137 | b.s = this.s; 138 | var c = Math.floor(a / this.DB); 139 | if (c >= this.t) return void (b.t = 0); 140 | var d = a % this.DB, e = this.DB - d, f = (1 << d) - 1; 141 | b[0] = this[c] >> d; 142 | for (var g = c + 1; g < this.t; ++g) b[g - c - 1] |= (this[g] & f) << e, b[g - c] = this[g] >> d; 143 | d > 0 && (b[this.t - c - 1] |= (this.s & f) << e), b.t = this.t - c, b.clamp() 144 | } 145 | 146 | function bnpSubTo(a, b) { 147 | for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) d += this[c] - a[c], b[c++] = d & this.DM, d >>= this.DB; 148 | if (a.t < this.t) { 149 | for (d -= a.s; c < this.t;) d += this[c], b[c++] = d & this.DM, d >>= this.DB; 150 | d += this.s 151 | } else { 152 | for (d += this.s; c < a.t;) d -= a[c], b[c++] = d & this.DM, d >>= this.DB; 153 | d -= a.s 154 | } 155 | b.s = 0 > d ? -1 : 0, -1 > d ? b[c++] = this.DV + d : d > 0 && (b[c++] = d), b.t = c, b.clamp() 156 | } 157 | 158 | function bnpMultiplyTo(a, b) { 159 | var c = this.abs(), d = a.abs(), e = c.t; 160 | for (b.t = e + d.t; --e >= 0;) b[e] = 0; 161 | for (e = 0; e < d.t; ++e) b[e + c.t] = c.am(0, d[e], b, e, 0, c.t); 162 | b.s = 0, b.clamp(), this.s != a.s && BigInteger.ZERO.subTo(b, b) 163 | } 164 | 165 | function bnpSquareTo(a) { 166 | for (var b = this.abs(), c = a.t = 2 * b.t; --c >= 0;) a[c] = 0; 167 | for (c = 0; c < b.t - 1; ++c) { 168 | var d = b.am(c, b[c], a, 2 * c, 0, 1); 169 | (a[c + b.t] += b.am(c + 1, 2 * b[c], a, 2 * c + 1, d, b.t - c - 1)) >= b.DV && (a[c + b.t] -= b.DV, a[c + b.t + 1] = 1) 170 | } 171 | a.t > 0 && (a[a.t - 1] += b.am(c, b[c], a, 2 * c, 0, 1)), a.s = 0, a.clamp() 172 | } 173 | 174 | function bnpDivRemTo(a, b, c) { 175 | var d = a.abs(); 176 | if (!(d.t <= 0)) { 177 | var e = this.abs(); 178 | if (e.t < d.t) return null != b && b.fromInt(0), void (null != c && this.copyTo(c)); 179 | null == c && (c = nbi()); 180 | var f = nbi(), g = this.s, h = a.s, i = this.DB - nbits(d[d.t - 1]); 181 | i > 0 ? (d.lShiftTo(i, f), e.lShiftTo(i, c)) : (d.copyTo(f), e.copyTo(c)); 182 | var j = f.t, k = f[j - 1]; 183 | if (0 != k) { 184 | var l = k * (1 << this.F1) + (j > 1 ? f[j - 2] >> this.F2 : 0), m = this.FV / l, n = (1 << this.F1) / l, 185 | o = 1 << this.F2, p = c.t, q = p - j, r = null == b ? nbi() : b; 186 | for (f.dlShiftTo(q, r), c.compareTo(r) >= 0 && (c[c.t++] = 1, c.subTo(r, c)), BigInteger.ONE.dlShiftTo(j, r), r.subTo(f, f); f.t < j;) f[f.t++] = 0; 187 | for (; --q >= 0;) { 188 | var s = c[--p] == k ? this.DM : Math.floor(c[p] * m + (c[p - 1] + o) * n); 189 | if ((c[p] += f.am(0, s, c, q, 0, j)) < s) for (f.dlShiftTo(q, r), c.subTo(r, c); c[p] < --s;) c.subTo(r, c) 190 | } 191 | null != b && (c.drShiftTo(j, b), g != h && BigInteger.ZERO.subTo(b, b)), c.t = j, c.clamp(), i > 0 && c.rShiftTo(i, c), 0 > g && BigInteger.ZERO.subTo(c, c) 192 | } 193 | } 194 | } 195 | 196 | function bnMod(a) { 197 | var b = nbi(); 198 | return this.abs().divRemTo(a, null, b), this.s < 0 && b.compareTo(BigInteger.ZERO) > 0 && a.subTo(b, b), b 199 | } 200 | 201 | function Classic(a) { 202 | this.m = a 203 | } 204 | 205 | function cConvert(a) { 206 | return a.s < 0 || a.compareTo(this.m) >= 0 ? a.mod(this.m) : a 207 | } 208 | 209 | function cRevert(a) { 210 | return a 211 | } 212 | 213 | function cReduce(a) { 214 | a.divRemTo(this.m, null, a) 215 | } 216 | 217 | function cMulTo(a, b, c) { 218 | a.multiplyTo(b, c), this.reduce(c) 219 | } 220 | 221 | function cSqrTo(a, b) { 222 | a.squareTo(b), this.reduce(b) 223 | } 224 | 225 | function bnpInvDigit() { 226 | if (this.t < 1) return 0; 227 | var a = this[0]; 228 | if (0 == (1 & a)) return 0; 229 | var b = 3 & a; 230 | return b = b * (2 - (15 & a) * b) & 15, b = b * (2 - (255 & a) * b) & 255, b = b * (2 - ((65535 & a) * b & 65535)) & 65535, b = b * (2 - a * b % this.DV) % this.DV, b > 0 ? this.DV - b : -b 231 | } 232 | 233 | function Montgomery(a) { 234 | this.m = a, this.mp = a.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << a.DB - 15) - 1, this.mt2 = 2 * a.t 235 | } 236 | 237 | function montConvert(a) { 238 | var b = nbi(); 239 | return a.abs().dlShiftTo(this.m.t, b), b.divRemTo(this.m, null, b), a.s < 0 && b.compareTo(BigInteger.ZERO) > 0 && this.m.subTo(b, b), b 240 | } 241 | 242 | function montRevert(a) { 243 | var b = nbi(); 244 | return a.copyTo(b), this.reduce(b), b 245 | } 246 | 247 | function montReduce(a) { 248 | for (; a.t <= this.mt2;) a[a.t++] = 0; 249 | for (var b = 0; b < this.m.t; ++b) { 250 | var c = 32767 & a[b], d = c * this.mpl + ((c * this.mph + (a[b] >> 15) * this.mpl & this.um) << 15) & a.DM; 251 | for (c = b + this.m.t, a[c] += this.m.am(0, d, a, b, 0, this.m.t); a[c] >= a.DV;) a[c] -= a.DV, a[++c]++ 252 | } 253 | a.clamp(), a.drShiftTo(this.m.t, a), a.compareTo(this.m) >= 0 && a.subTo(this.m, a) 254 | } 255 | 256 | function montSqrTo(a, b) { 257 | a.squareTo(b), this.reduce(b) 258 | } 259 | 260 | function montMulTo(a, b, c) { 261 | a.multiplyTo(b, c), this.reduce(c) 262 | } 263 | 264 | function bnpIsEven() { 265 | return 0 == (this.t > 0 ? 1 & this[0] : this.s) 266 | } 267 | 268 | function bnpExp(a, b) { 269 | if (a > 4294967295 || 1 > a) return BigInteger.ONE; 270 | var c = nbi(), d = nbi(), e = b.convert(this), f = nbits(a) - 1; 271 | for (e.copyTo(c); --f >= 0;) if (b.sqrTo(c, d), (a & 1 << f) > 0) b.mulTo(d, e, c); else { 272 | var g = c; 273 | c = d, d = g 274 | } 275 | return b.revert(c) 276 | } 277 | 278 | function bnModPowInt(a, b) { 279 | var c; 280 | return c = 256 > a || b.isEven() ? new Classic(b) : new Montgomery(b), this.exp(a, c) 281 | } 282 | 283 | function bnClone() { 284 | var a = nbi(); 285 | return this.copyTo(a), a 286 | } 287 | 288 | function bnIntValue() { 289 | if (this.s < 0) { 290 | if (1 == this.t) return this[0] - this.DV; 291 | if (0 == this.t) return -1 292 | } else { 293 | if (1 == this.t) return this[0]; 294 | if (0 == this.t) return 0 295 | } 296 | return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0] 297 | } 298 | 299 | function bnByteValue() { 300 | return 0 == this.t ? this.s : this[0] << 24 >> 24 301 | } 302 | 303 | function bnShortValue() { 304 | return 0 == this.t ? this.s : this[0] << 16 >> 16 305 | } 306 | 307 | function bnpChunkSize(a) { 308 | return Math.floor(Math.LN2 * this.DB / Math.log(a)) 309 | } 310 | 311 | function bnSigNum() { 312 | return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1 313 | } 314 | 315 | function bnpToRadix(a) { 316 | if (null == a && (a = 10), 0 == this.signum() || 2 > a || a > 36) return "0"; 317 | var b = this.chunkSize(a), c = Math.pow(a, b), d = nbv(c), e = nbi(), f = nbi(), g = ""; 318 | for (this.divRemTo(d, e, f); e.signum() > 0;) g = (c + f.intValue()).toString(a).substr(1) + g, e.divRemTo(d, e, f); 319 | return f.intValue().toString(a) + g 320 | } 321 | 322 | function bnpFromRadix(a, b) { 323 | this.fromInt(0), null == b && (b = 10); 324 | for (var c = this.chunkSize(b), d = Math.pow(b, c), e = !1, f = 0, g = 0, h = 0; h < a.length; ++h) { 325 | var i = intAt(a, h); 326 | 0 > i ? "-" == a.charAt(h) && 0 == this.signum() && (e = !0) : (g = b * g + i, ++f >= c && (this.dMultiply(d), this.dAddOffset(g, 0), f = 0, g = 0)) 327 | } 328 | f > 0 && (this.dMultiply(Math.pow(b, f)), this.dAddOffset(g, 0)), e && BigInteger.ZERO.subTo(this, this) 329 | } 330 | 331 | function bnpFromNumber(a, b, c) { 332 | if ("number" == typeof b) if (2 > a) this.fromInt(1); else for (this.fromNumber(a, c), this.testBit(a - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(b);) this.dAddOffset(2, 0), this.bitLength() > a && this.subTo(BigInteger.ONE.shiftLeft(a - 1), this); else { 333 | var d = new Array, e = 7 & a; 334 | d.length = (a >> 3) + 1, b.nextBytes(d), e > 0 ? d[0] &= (1 << e) - 1 : d[0] = 0, this.fromString(d, 256) 335 | } 336 | } 337 | 338 | function bnToByteArray() { 339 | var a = this.t, b = new Array; 340 | b[0] = this.s; 341 | var c, d = this.DB - a * this.DB % 8, e = 0; 342 | if (a-- > 0) for (d < this.DB && (c = this[a] >> d) != (this.s & this.DM) >> d && (b[e++] = c | this.s << this.DB - d); a >= 0;) 8 > d ? (c = (this[a] & (1 << d) - 1) << 8 - d, c |= this[--a] >> (d += this.DB - 8)) : (c = this[a] >> (d -= 8) & 255, 0 >= d && (d += this.DB, --a)), 0 != (128 & c) && (c |= -256), 0 == e && (128 & this.s) != (128 & c) && ++e, (e > 0 || c != this.s) && (b[e++] = c); 343 | return b 344 | } 345 | 346 | function bnEquals(a) { 347 | return 0 == this.compareTo(a) 348 | } 349 | 350 | function bnMin(a) { 351 | return this.compareTo(a) < 0 ? this : a 352 | } 353 | 354 | function bnMax(a) { 355 | return this.compareTo(a) > 0 ? this : a 356 | } 357 | 358 | function bnpBitwiseTo(a, b, c) { 359 | var d, e, f = Math.min(a.t, this.t); 360 | for (d = 0; f > d; ++d) c[d] = b(this[d], a[d]); 361 | if (a.t < this.t) { 362 | for (e = a.s & this.DM, d = f; d < this.t; ++d) c[d] = b(this[d], e); 363 | c.t = this.t 364 | } else { 365 | for (e = this.s & this.DM, d = f; d < a.t; ++d) c[d] = b(e, a[d]); 366 | c.t = a.t 367 | } 368 | c.s = b(this.s, a.s), c.clamp() 369 | } 370 | 371 | function op_and(a, b) { 372 | return a & b 373 | } 374 | 375 | function bnAnd(a) { 376 | var b = nbi(); 377 | return this.bitwiseTo(a, op_and, b), b 378 | } 379 | 380 | function op_or(a, b) { 381 | return a | b 382 | } 383 | 384 | function bnOr(a) { 385 | var b = nbi(); 386 | return this.bitwiseTo(a, op_or, b), b 387 | } 388 | 389 | function op_xor(a, b) { 390 | return a ^ b 391 | } 392 | 393 | function bnXor(a) { 394 | var b = nbi(); 395 | return this.bitwiseTo(a, op_xor, b), b 396 | } 397 | 398 | function op_andnot(a, b) { 399 | return a & ~b 400 | } 401 | 402 | function bnAndNot(a) { 403 | var b = nbi(); 404 | return this.bitwiseTo(a, op_andnot, b), b 405 | } 406 | 407 | function bnNot() { 408 | for (var a = nbi(), b = 0; b < this.t; ++b) a[b] = this.DM & ~this[b]; 409 | return a.t = this.t, a.s = ~this.s, a 410 | } 411 | 412 | function bnShiftLeft(a) { 413 | var b = nbi(); 414 | return 0 > a ? this.rShiftTo(-a, b) : this.lShiftTo(a, b), b 415 | } 416 | 417 | function bnShiftRight(a) { 418 | var b = nbi(); 419 | return 0 > a ? this.lShiftTo(-a, b) : this.rShiftTo(a, b), b 420 | } 421 | 422 | function lbit(a) { 423 | if (0 == a) return -1; 424 | var b = 0; 425 | return 0 == (65535 & a) && (a >>= 16, b += 16), 0 == (255 & a) && (a >>= 8, b += 8), 0 == (15 & a) && (a >>= 4, b += 4), 0 == (3 & a) && (a >>= 2, b += 2), 0 == (1 & a) && ++b, b 426 | } 427 | 428 | function bnGetLowestSetBit() { 429 | for (var a = 0; a < this.t; ++a) if (0 != this[a]) return a * this.DB + lbit(this[a]); 430 | return this.s < 0 ? this.t * this.DB : -1 431 | } 432 | 433 | function cbit(a) { 434 | for (var b = 0; 0 != a;) a &= a - 1, ++b; 435 | return b 436 | } 437 | 438 | function bnBitCount() { 439 | for (var a = 0, b = this.s & this.DM, c = 0; c < this.t; ++c) a += cbit(this[c] ^ b); 440 | return a 441 | } 442 | 443 | function bnTestBit(a) { 444 | var b = Math.floor(a / this.DB); 445 | return b >= this.t ? 0 != this.s : 0 != (this[b] & 1 << a % this.DB) 446 | } 447 | 448 | function bnpChangeBit(a, b) { 449 | var c = BigInteger.ONE.shiftLeft(a); 450 | return this.bitwiseTo(c, b, c), c 451 | } 452 | 453 | function bnSetBit(a) { 454 | return this.changeBit(a, op_or) 455 | } 456 | 457 | function bnClearBit(a) { 458 | return this.changeBit(a, op_andnot) 459 | } 460 | 461 | function bnFlipBit(a) { 462 | return this.changeBit(a, op_xor) 463 | } 464 | 465 | function bnpAddTo(a, b) { 466 | for (var c = 0, d = 0, e = Math.min(a.t, this.t); e > c;) d += this[c] + a[c], b[c++] = d & this.DM, d >>= this.DB; 467 | if (a.t < this.t) { 468 | for (d += a.s; c < this.t;) d += this[c], b[c++] = d & this.DM, d >>= this.DB; 469 | d += this.s 470 | } else { 471 | for (d += this.s; c < a.t;) d += a[c], b[c++] = d & this.DM, d >>= this.DB; 472 | d += a.s 473 | } 474 | b.s = 0 > d ? -1 : 0, d > 0 ? b[c++] = d : -1 > d && (b[c++] = this.DV + d), b.t = c, b.clamp() 475 | } 476 | 477 | function bnAdd(a) { 478 | var b = nbi(); 479 | return this.addTo(a, b), b 480 | } 481 | 482 | function bnSubtract(a) { 483 | var b = nbi(); 484 | return this.subTo(a, b), b 485 | } 486 | 487 | function bnMultiply(a) { 488 | var b = nbi(); 489 | return this.multiplyTo(a, b), b 490 | } 491 | 492 | function bnSquare() { 493 | var a = nbi(); 494 | return this.squareTo(a), a 495 | } 496 | 497 | function bnDivide(a) { 498 | var b = nbi(); 499 | return this.divRemTo(a, b, null), b 500 | } 501 | 502 | function bnRemainder(a) { 503 | var b = nbi(); 504 | return this.divRemTo(a, null, b), b 505 | } 506 | 507 | function bnDivideAndRemainder(a) { 508 | var b = nbi(), c = nbi(); 509 | return this.divRemTo(a, b, c), new Array(b, c) 510 | } 511 | 512 | function bnpDMultiply(a) { 513 | this[this.t] = this.am(0, a - 1, this, 0, 0, this.t), ++this.t, this.clamp() 514 | } 515 | 516 | function bnpDAddOffset(a, b) { 517 | if (0 != a) { 518 | for (; this.t <= b;) this[this.t++] = 0; 519 | for (this[b] += a; this[b] >= this.DV;) this[b] -= this.DV, ++b >= this.t && (this[this.t++] = 0), ++this[b] 520 | } 521 | } 522 | 523 | function NullExp() { 524 | } 525 | 526 | function nNop(a) { 527 | return a 528 | } 529 | 530 | function nMulTo(a, b, c) { 531 | a.multiplyTo(b, c) 532 | } 533 | 534 | function nSqrTo(a, b) { 535 | a.squareTo(b) 536 | } 537 | 538 | function bnPow(a) { 539 | return this.exp(a, new NullExp) 540 | } 541 | 542 | function bnpMultiplyLowerTo(a, b, c) { 543 | var d = Math.min(this.t + a.t, b); 544 | for (c.s = 0, c.t = d; d > 0;) c[--d] = 0; 545 | var e; 546 | for (e = c.t - this.t; e > d; ++d) c[d + this.t] = this.am(0, a[d], c, d, 0, this.t); 547 | for (e = Math.min(a.t, b); e > d; ++d) this.am(0, a[d], c, d, 0, b - d); 548 | c.clamp() 549 | } 550 | 551 | function bnpMultiplyUpperTo(a, b, c) { 552 | --b; 553 | var d = c.t = this.t + a.t - b; 554 | for (c.s = 0; --d >= 0;) c[d] = 0; 555 | for (d = Math.max(b - this.t, 0); d < a.t; ++d) c[this.t + d - b] = this.am(b - d, a[d], c, 0, 0, this.t + d - b); 556 | c.clamp(), c.drShiftTo(1, c) 557 | } 558 | 559 | function Barrett(a) { 560 | this.r2 = nbi(), this.q3 = nbi(), BigInteger.ONE.dlShiftTo(2 * a.t, this.r2), this.mu = this.r2.divide(a), this.m = a 561 | } 562 | 563 | function barrettConvert(a) { 564 | if (a.s < 0 || a.t > 2 * this.m.t) return a.mod(this.m); 565 | if (a.compareTo(this.m) < 0) return a; 566 | var b = nbi(); 567 | return a.copyTo(b), this.reduce(b), b 568 | } 569 | 570 | function barrettRevert(a) { 571 | return a 572 | } 573 | 574 | function barrettReduce(a) { 575 | for (a.drShiftTo(this.m.t - 1, this.r2), a.t > this.m.t + 1 && (a.t = this.m.t + 1, a.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); a.compareTo(this.r2) < 0;) a.dAddOffset(1, this.m.t + 1); 576 | for (a.subTo(this.r2, a); a.compareTo(this.m) >= 0;) a.subTo(this.m, a) 577 | } 578 | 579 | function barrettSqrTo(a, b) { 580 | a.squareTo(b), this.reduce(b) 581 | } 582 | 583 | function barrettMulTo(a, b, c) { 584 | a.multiplyTo(b, c), this.reduce(c) 585 | } 586 | 587 | function bnModPow(a, b) { 588 | var c, d, e = a.bitLength(), f = nbv(1); 589 | if (0 >= e) return f; 590 | c = 18 > e ? 1 : 48 > e ? 3 : 144 > e ? 4 : 768 > e ? 5 : 6, d = 8 > e ? new Classic(b) : b.isEven() ? new Barrett(b) : new Montgomery(b); 591 | var g = new Array, h = 3, i = c - 1, j = (1 << c) - 1; 592 | if (g[1] = d.convert(this), c > 1) { 593 | var k = nbi(); 594 | for (d.sqrTo(g[1], k); j >= h;) g[h] = nbi(), d.mulTo(k, g[h - 2], g[h]), h += 2 595 | } 596 | var l, m, n = a.t - 1, o = !0, p = nbi(); 597 | for (e = nbits(a[n]) - 1; n >= 0;) { 598 | for (e >= i ? l = a[n] >> e - i & j : (l = (a[n] & (1 << e + 1) - 1) << i - e, n > 0 && (l |= a[n - 1] >> this.DB + e - i)), h = c; 0 == (1 & l);) l >>= 1, --h; 599 | if ((e -= h) < 0 && (e += this.DB, --n), o) g[l].copyTo(f), o = !1; else { 600 | for (; h > 1;) d.sqrTo(f, p), d.sqrTo(p, f), h -= 2; 601 | h > 0 ? d.sqrTo(f, p) : (m = f, f = p, p = m), d.mulTo(p, g[l], f) 602 | } 603 | for (; n >= 0 && 0 == (a[n] & 1 << e);) d.sqrTo(f, p), m = f, f = p, p = m, --e < 0 && (e = this.DB - 1, --n) 604 | } 605 | return d.revert(f) 606 | } 607 | 608 | function bnGCD(a) { 609 | var b = this.s < 0 ? this.negate() : this.clone(), c = a.s < 0 ? a.negate() : a.clone(); 610 | if (b.compareTo(c) < 0) { 611 | var d = b; 612 | b = c, c = d 613 | } 614 | var e = b.getLowestSetBit(), f = c.getLowestSetBit(); 615 | if (0 > f) return b; 616 | for (f > e && (f = e), f > 0 && (b.rShiftTo(f, b), c.rShiftTo(f, c)); b.signum() > 0;) (e = b.getLowestSetBit()) > 0 && b.rShiftTo(e, b), (e = c.getLowestSetBit()) > 0 && c.rShiftTo(e, c), b.compareTo(c) >= 0 ? (b.subTo(c, b), b.rShiftTo(1, b)) : (c.subTo(b, c), c.rShiftTo(1, c)); 617 | return f > 0 && c.lShiftTo(f, c), c 618 | } 619 | 620 | function bnpModInt(a) { 621 | if (0 >= a) return 0; 622 | var b = this.DV % a, c = this.s < 0 ? a - 1 : 0; 623 | if (this.t > 0) if (0 == b) c = this[0] % a; else for (var d = this.t - 1; d >= 0; --d) c = (b * c + this[d]) % a; 624 | return c 625 | } 626 | 627 | function bnModInverse(a) { 628 | var b = a.isEven(); 629 | if (this.isEven() && b || 0 == a.signum()) return BigInteger.ZERO; 630 | for (var c = a.clone(), d = this.clone(), e = nbv(1), f = nbv(0), g = nbv(0), h = nbv(1); 0 != c.signum();) { 631 | for (; c.isEven();) c.rShiftTo(1, c), b ? (e.isEven() && f.isEven() || (e.addTo(this, e), f.subTo(a, f)), e.rShiftTo(1, e)) : f.isEven() || f.subTo(a, f), f.rShiftTo(1, f); 632 | for (; d.isEven();) d.rShiftTo(1, d), b ? (g.isEven() && h.isEven() || (g.addTo(this, g), h.subTo(a, h)), g.rShiftTo(1, g)) : h.isEven() || h.subTo(a, h), h.rShiftTo(1, h); 633 | c.compareTo(d) >= 0 ? (c.subTo(d, c), b && e.subTo(g, e), f.subTo(h, f)) : (d.subTo(c, d), b && g.subTo(e, g), h.subTo(f, h)) 634 | } 635 | return 0 != d.compareTo(BigInteger.ONE) ? BigInteger.ZERO : h.compareTo(a) >= 0 ? h.subtract(a) : h.signum() < 0 ? (h.addTo(a, h), h.signum() < 0 ? h.add(a) : h) : h 636 | } 637 | 638 | function bnIsProbablePrime(a) { 639 | var b, c = this.abs(); 640 | if (1 == c.t && c[0] <= lowprimes[lowprimes.length - 1]) { 641 | for (b = 0; b < lowprimes.length; ++b) if (c[0] == lowprimes[b]) return !0; 642 | return !1 643 | } 644 | if (c.isEven()) return !1; 645 | for (b = 1; b < lowprimes.length;) { 646 | for (var d = lowprimes[b], e = b + 1; e < lowprimes.length && lplim > d;) d *= lowprimes[e++]; 647 | for (d = c.modInt(d); e > b;) if (d % lowprimes[b++] == 0) return !1 648 | } 649 | return c.millerRabin(a) 650 | } 651 | 652 | function bnpMillerRabin(a) { 653 | var b = this.subtract(BigInteger.ONE), c = b.getLowestSetBit(); 654 | if (0 >= c) return !1; 655 | var d = b.shiftRight(c); 656 | a = a + 1 >> 1, a > lowprimes.length && (a = lowprimes.length); 657 | for (var e = nbi(), f = 0; a > f; ++f) { 658 | e.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]); 659 | var g = e.modPow(d, this); 660 | if (0 != g.compareTo(BigInteger.ONE) && 0 != g.compareTo(b)) { 661 | for (var h = 1; h++ < c && 0 != g.compareTo(b);) if (g = g.modPowInt(2, this), 0 == g.compareTo(BigInteger.ONE)) return !1; 662 | if (0 != g.compareTo(b)) return !1 663 | } 664 | } 665 | return !0 666 | } 667 | 668 | function Arcfour() { 669 | this.i = 0, this.j = 0, this.S = new Array 670 | } 671 | 672 | function ARC4init(a) { 673 | var b, c, d; 674 | for (b = 0; 256 > b; ++b) this.S[b] = b; 675 | for (c = 0, b = 0; 256 > b; ++b) c = c + this.S[b] + a[b % a.length] & 255, d = this.S[b], this.S[b] = this.S[c], this.S[c] = d; 676 | this.i = 0, this.j = 0 677 | } 678 | 679 | function ARC4next() { 680 | var a; 681 | return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, a = this.S[this.i], this.S[this.i] = this.S[this.j], this.S[this.j] = a, this.S[a + this.S[this.i] & 255] 682 | } 683 | 684 | function prng_newstate() { 685 | return new Arcfour 686 | } 687 | 688 | function rng_get_byte() { 689 | if (null == rng_state) { 690 | for (rng_state = prng_newstate(); rng_psize > rng_pptr;) { 691 | var a = Math.floor(65536 * Math.random()); 692 | rng_pool[rng_pptr++] = 255 & a 693 | } 694 | for (rng_state.init(rng_pool), rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; 695 | rng_pptr = 0 696 | } 697 | return rng_state.next() 698 | } 699 | 700 | function rng_get_bytes(a) { 701 | var b; 702 | for (b = 0; b < a.length; ++b) a[b] = rng_get_byte() 703 | } 704 | 705 | function SecureRandom() { 706 | } 707 | 708 | function parseBigInt(a, b) { 709 | return new BigInteger(a, b) 710 | } 711 | 712 | function linebrk(a, b) { 713 | for (var c = "", d = 0; d + b < a.length;) c += a.substring(d, d + b) + "\n", d += b; 714 | return c + a.substring(d, a.length) 715 | } 716 | 717 | function byte2Hex(a) { 718 | return 16 > a ? "0" + a.toString(16) : a.toString(16) 719 | } 720 | 721 | function pkcs1pad2(a, b) { 722 | if (b < a.length + 11) return console.error("Message too long for RSA"), null; 723 | for (var c = new Array, d = a.length - 1; d >= 0 && b > 0;) { 724 | var e = a.charCodeAt(d--); 725 | 128 > e ? c[--b] = e : e > 127 && 2048 > e ? (c[--b] = 63 & e | 128, c[--b] = e >> 6 | 192) : (c[--b] = 63 & e | 128, c[--b] = e >> 6 & 63 | 128, c[--b] = e >> 12 | 224) 726 | } 727 | c[--b] = 0; 728 | for (var f = new SecureRandom, g = new Array; b > 2;) { 729 | for (g[0] = 0; 0 == g[0];) f.nextBytes(g); 730 | c[--b] = g[0] 731 | } 732 | return c[--b] = 2, c[--b] = 0, new BigInteger(c) 733 | } 734 | 735 | function RSAKey() { 736 | this.n = null, this.e = 0, this.d = null, this.p = null, this.q = null, this.dmp1 = null, this.dmq1 = null, this.coeff = null 737 | } 738 | 739 | function RSASetPublic(a, b) { 740 | null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = parseBigInt(a, 16), this.e = parseInt(b, 16)) : console.error("Invalid RSA public key") 741 | } 742 | 743 | function RSADoPublic(a) { 744 | return a.modPowInt(this.e, this.n) 745 | } 746 | 747 | function RSAEncrypt(a) { 748 | var b = pkcs1pad2(a, this.n.bitLength() + 7 >> 3); 749 | if (null == b) return null; 750 | var c = this.doPublic(b); 751 | if (null == c) return null; 752 | var d = c.toString(16); 753 | return 0 == (1 & d.length) ? d : "0" + d 754 | } 755 | 756 | function pkcs1unpad2(a, b) { 757 | for (var c = a.toByteArray(), d = 0; d < c.length && 0 == c[d];) ++d; 758 | if (c.length - d != b - 1 || 2 != c[d]) return null; 759 | for (++d; 0 != c[d];) if (++d >= c.length) return null; 760 | for (var e = ""; ++d < c.length;) { 761 | var f = 255 & c[d]; 762 | 128 > f ? e += String.fromCharCode(f) : f > 191 && 224 > f ? (e += String.fromCharCode((31 & f) << 6 | 63 & c[d + 1]), ++d) : (e += String.fromCharCode((15 & f) << 12 | (63 & c[d + 1]) << 6 | 63 & c[d + 2]), d += 2) 763 | } 764 | return e 765 | } 766 | 767 | function RSASetPrivate(a, b, c) { 768 | null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = parseBigInt(a, 16), this.e = parseInt(b, 16), this.d = parseBigInt(c, 16)) : console.error("Invalid RSA private key") 769 | } 770 | 771 | function RSASetPrivateEx(a, b, c, d, e, f, g, h) { 772 | null != a && null != b && a.length > 0 && b.length > 0 ? (this.n = parseBigInt(a, 16), this.e = parseInt(b, 16), this.d = parseBigInt(c, 16), this.p = parseBigInt(d, 16), this.q = parseBigInt(e, 16), this.dmp1 = parseBigInt(f, 16), this.dmq1 = parseBigInt(g, 16), this.coeff = parseBigInt(h, 16)) : console.error("Invalid RSA private key") 773 | } 774 | 775 | function RSAGenerate(a, b) { 776 | var c = new SecureRandom, d = a >> 1; 777 | this.e = parseInt(b, 16); 778 | for (var e = new BigInteger(b, 16); ;) { 779 | for (; this.p = new BigInteger(a - d, 1, c), 0 != this.p.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE) || !this.p.isProbablePrime(10);) ; 780 | for (; this.q = new BigInteger(d, 1, c), 0 != this.q.subtract(BigInteger.ONE).gcd(e).compareTo(BigInteger.ONE) || !this.q.isProbablePrime(10);) ; 781 | if (this.p.compareTo(this.q) <= 0) { 782 | var f = this.p; 783 | this.p = this.q, this.q = f 784 | } 785 | var g = this.p.subtract(BigInteger.ONE), h = this.q.subtract(BigInteger.ONE), i = g.multiply(h); 786 | if (0 == i.gcd(e).compareTo(BigInteger.ONE)) { 787 | this.n = this.p.multiply(this.q), this.d = e.modInverse(i), this.dmp1 = this.d.mod(g), this.dmq1 = this.d.mod(h), this.coeff = this.q.modInverse(this.p); 788 | break 789 | } 790 | } 791 | } 792 | 793 | function RSADoPrivate(a) { 794 | if (null == this.p || null == this.q) return a.modPow(this.d, this.n); 795 | for (var b = a.mod(this.p).modPow(this.dmp1, this.p), c = a.mod(this.q).modPow(this.dmq1, this.q); b.compareTo(c) < 0;) b = b.add(this.p); 796 | return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c) 797 | } 798 | 799 | function RSADecrypt(a) { 800 | var b = parseBigInt(a, 16), c = this.doPrivate(b); 801 | return null == c ? null : pkcs1unpad2(c, this.n.bitLength() + 7 >> 3) 802 | } 803 | 804 | function hex2b64(a) { 805 | var b, c, d = ""; 806 | for (b = 0; b + 3 <= a.length; b += 3) c = parseInt(a.substring(b, b + 3), 16), d += b64map.charAt(c >> 6) + b64map.charAt(63 & c); 807 | for (b + 1 == a.length ? (c = parseInt(a.substring(b, b + 1), 16), d += b64map.charAt(c << 2)) : b + 2 == a.length && (c = parseInt(a.substring(b, b + 2), 16), d += b64map.charAt(c >> 2) + b64map.charAt((3 & c) << 4)); (3 & d.length) > 0;) d += b64pad; 808 | return d 809 | } 810 | 811 | function b64tohex(a) { 812 | var b, c, d = "", e = 0; 813 | for (b = 0; b < a.length && a.charAt(b) != b64pad; ++b) v = b64map.indexOf(a.charAt(b)), 0 > v || (0 == e ? (d += int2char(v >> 2), c = 3 & v, e = 1) : 1 == e ? (d += int2char(c << 2 | v >> 4), c = 15 & v, e = 2) : 2 == e ? (d += int2char(c), d += int2char(v >> 2), c = 3 & v, e = 3) : (d += int2char(c << 2 | v >> 4), d += int2char(15 & v), e = 0)); 814 | return 1 == e && (d += int2char(c << 2)), d 815 | } 816 | 817 | function b64toBA(a) { 818 | var b, c = b64tohex(a), d = new Array; 819 | for (b = 0; 2 * b < c.length; ++b) d[b] = parseInt(c.substring(2 * b, 2 * b + 2), 16); 820 | return d 821 | } 822 | 823 | var dbits, canary = 0xdeadbeefcafe, j_lm = 15715070 == (16777215 & canary); 824 | j_lm && "Microsoft Internet Explorer" == navigator.appName ? (BigInteger.prototype.am = am2, dbits = 30) : j_lm && "Netscape" != navigator.appName ? (BigInteger.prototype.am = am1, dbits = 26) : (BigInteger.prototype.am = am3, dbits = 28), BigInteger.prototype.DB = dbits, BigInteger.prototype.DM = (1 << dbits) - 1, BigInteger.prototype.DV = 1 << dbits; 825 | var BI_FP = 52; 826 | BigInteger.prototype.FV = Math.pow(2, BI_FP), BigInteger.prototype.F1 = BI_FP - dbits, BigInteger.prototype.F2 = 2 * dbits - BI_FP; 827 | var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz", BI_RC = new Array, rr, vv; 828 | for (rr = "0".charCodeAt(0), vv = 0; 9 >= vv; ++vv) BI_RC[rr++] = vv; 829 | for (rr = "a".charCodeAt(0), vv = 10; 36 > vv; ++vv) BI_RC[rr++] = vv; 830 | for (rr = "A".charCodeAt(0), vv = 10; 36 > vv; ++vv) BI_RC[rr++] = vv; 831 | Classic.prototype.convert = cConvert, Classic.prototype.revert = cRevert, Classic.prototype.reduce = cReduce, Classic.prototype.mulTo = cMulTo, Classic.prototype.sqrTo = cSqrTo, Montgomery.prototype.convert = montConvert, Montgomery.prototype.revert = montRevert, Montgomery.prototype.reduce = montReduce, Montgomery.prototype.mulTo = montMulTo, Montgomery.prototype.sqrTo = montSqrTo, BigInteger.prototype.copyTo = bnpCopyTo, BigInteger.prototype.fromInt = bnpFromInt, BigInteger.prototype.fromString = bnpFromString, BigInteger.prototype.clamp = bnpClamp, BigInteger.prototype.dlShiftTo = bnpDLShiftTo, BigInteger.prototype.drShiftTo = bnpDRShiftTo, BigInteger.prototype.lShiftTo = bnpLShiftTo, BigInteger.prototype.rShiftTo = bnpRShiftTo, BigInteger.prototype.subTo = bnpSubTo, BigInteger.prototype.multiplyTo = bnpMultiplyTo, BigInteger.prototype.squareTo = bnpSquareTo, BigInteger.prototype.divRemTo = bnpDivRemTo, BigInteger.prototype.invDigit = bnpInvDigit, BigInteger.prototype.isEven = bnpIsEven, BigInteger.prototype.exp = bnpExp, BigInteger.prototype.toString = bnToString, BigInteger.prototype.negate = bnNegate, BigInteger.prototype.abs = bnAbs, BigInteger.prototype.compareTo = bnCompareTo, BigInteger.prototype.bitLength = bnBitLength, BigInteger.prototype.mod = bnMod, BigInteger.prototype.modPowInt = bnModPowInt, BigInteger.ZERO = nbv(0), BigInteger.ONE = nbv(1), NullExp.prototype.convert = nNop, NullExp.prototype.revert = nNop, NullExp.prototype.mulTo = nMulTo, NullExp.prototype.sqrTo = nSqrTo, Barrett.prototype.convert = barrettConvert, Barrett.prototype.revert = barrettRevert, Barrett.prototype.reduce = barrettReduce, Barrett.prototype.mulTo = barrettMulTo, Barrett.prototype.sqrTo = barrettSqrTo; 832 | var lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], 833 | lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; 834 | BigInteger.prototype.chunkSize = bnpChunkSize, BigInteger.prototype.toRadix = bnpToRadix, BigInteger.prototype.fromRadix = bnpFromRadix, BigInteger.prototype.fromNumber = bnpFromNumber, BigInteger.prototype.bitwiseTo = bnpBitwiseTo, BigInteger.prototype.changeBit = bnpChangeBit, BigInteger.prototype.addTo = bnpAddTo, BigInteger.prototype.dMultiply = bnpDMultiply, BigInteger.prototype.dAddOffset = bnpDAddOffset, BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo, BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo, BigInteger.prototype.modInt = bnpModInt, BigInteger.prototype.millerRabin = bnpMillerRabin, BigInteger.prototype.clone = bnClone, BigInteger.prototype.intValue = bnIntValue, BigInteger.prototype.byteValue = bnByteValue, BigInteger.prototype.shortValue = bnShortValue, BigInteger.prototype.signum = bnSigNum, BigInteger.prototype.toByteArray = bnToByteArray, BigInteger.prototype.equals = bnEquals, BigInteger.prototype.min = bnMin, BigInteger.prototype.max = bnMax, BigInteger.prototype.and = bnAnd, BigInteger.prototype.or = bnOr, BigInteger.prototype.xor = bnXor, BigInteger.prototype.andNot = bnAndNot, BigInteger.prototype.not = bnNot, BigInteger.prototype.shiftLeft = bnShiftLeft, BigInteger.prototype.shiftRight = bnShiftRight, BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit, BigInteger.prototype.bitCount = bnBitCount, BigInteger.prototype.testBit = bnTestBit, BigInteger.prototype.setBit = bnSetBit, BigInteger.prototype.clearBit = bnClearBit, BigInteger.prototype.flipBit = bnFlipBit, BigInteger.prototype.add = bnAdd, BigInteger.prototype.subtract = bnSubtract, BigInteger.prototype.multiply = bnMultiply, BigInteger.prototype.divide = bnDivide, BigInteger.prototype.remainder = bnRemainder, BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder, BigInteger.prototype.modPow = bnModPow, BigInteger.prototype.modInverse = bnModInverse, BigInteger.prototype.pow = bnPow, BigInteger.prototype.gcd = bnGCD, BigInteger.prototype.isProbablePrime = bnIsProbablePrime, BigInteger.prototype.square = bnSquare, Arcfour.prototype.init = ARC4init, Arcfour.prototype.next = ARC4next; 835 | var rng_psize = 256, rng_state, rng_pool, rng_pptr; 836 | if (null == rng_pool) { 837 | rng_pool = new Array, rng_pptr = 0; 838 | var t; 839 | if (window.crypto && window.crypto.getRandomValues) { 840 | var z = new Uint32Array(256); 841 | for (window.crypto.getRandomValues(z), t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = 255 & z[t] 842 | } 843 | var onMouseMoveListener = function (a) { 844 | if (this.count = this.count || 0, this.count >= 256 || rng_pptr >= rng_psize) return void (window.removeEventListener ? window.removeEventListener("mousemove", onMouseMoveListener, !1) : window.detachEvent && window.detachEvent("onmousemove", onMouseMoveListener)); 845 | this.count += 1; 846 | var b = a.x + a.y; 847 | rng_pool[rng_pptr++] = 255 & b 848 | }; 849 | window.addEventListener ? window.addEventListener("mousemove", onMouseMoveListener, !1) : window.attachEvent && window.attachEvent("onmousemove", onMouseMoveListener) 850 | } 851 | SecureRandom.prototype.nextBytes = rng_get_bytes, RSAKey.prototype.doPublic = RSADoPublic, RSAKey.prototype.setPublic = RSASetPublic, RSAKey.prototype.encrypt = RSAEncrypt, RSAKey.prototype.doPrivate = RSADoPrivate, RSAKey.prototype.setPrivate = RSASetPrivate, RSAKey.prototype.setPrivateEx = RSASetPrivateEx, RSAKey.prototype.generate = RSAGenerate, RSAKey.prototype.decrypt = RSADecrypt, function () { 852 | var a = function (a, b, c) { 853 | var d = new SecureRandom, e = a >> 1; 854 | this.e = parseInt(b, 16); 855 | var f = new BigInteger(b, 16), g = this, h = function () { 856 | var b = function () { 857 | if (g.p.compareTo(g.q) <= 0) { 858 | var a = g.p; 859 | g.p = g.q, g.q = a 860 | } 861 | var b = g.p.subtract(BigInteger.ONE), d = g.q.subtract(BigInteger.ONE), e = b.multiply(d); 862 | 0 == e.gcd(f).compareTo(BigInteger.ONE) ? (g.n = g.p.multiply(g.q), g.d = f.modInverse(e), g.dmp1 = g.d.mod(b), g.dmq1 = g.d.mod(d), g.coeff = g.q.modInverse(g.p), setTimeout(function () { 863 | c() 864 | }, 0)) : setTimeout(h, 0) 865 | }, i = function () { 866 | g.q = nbi(), g.q.fromNumberAsync(e, 1, d, function () { 867 | g.q.subtract(BigInteger.ONE).gcda(f, function (a) { 868 | 0 == a.compareTo(BigInteger.ONE) && g.q.isProbablePrime(10) ? setTimeout(b, 0) : setTimeout(i, 0) 869 | }) 870 | }) 871 | }, j = function () { 872 | g.p = nbi(), g.p.fromNumberAsync(a - e, 1, d, function () { 873 | g.p.subtract(BigInteger.ONE).gcda(f, function (a) { 874 | 0 == a.compareTo(BigInteger.ONE) && g.p.isProbablePrime(10) ? setTimeout(i, 0) : setTimeout(j, 0) 875 | }) 876 | }) 877 | }; 878 | setTimeout(j, 0) 879 | }; 880 | setTimeout(h, 0) 881 | }; 882 | RSAKey.prototype.generateAsync = a; 883 | var b = function (a, b) { 884 | var c = this.s < 0 ? this.negate() : this.clone(), d = a.s < 0 ? a.negate() : a.clone(); 885 | if (c.compareTo(d) < 0) { 886 | var e = c; 887 | c = d, d = e 888 | } 889 | var f = c.getLowestSetBit(), g = d.getLowestSetBit(); 890 | if (0 > g) return void b(c); 891 | g > f && (g = f), g > 0 && (c.rShiftTo(g, c), d.rShiftTo(g, d)); 892 | var h = function () { 893 | (f = c.getLowestSetBit()) > 0 && c.rShiftTo(f, c), (f = d.getLowestSetBit()) > 0 && d.rShiftTo(f, d), c.compareTo(d) >= 0 ? (c.subTo(d, c), c.rShiftTo(1, c)) : (d.subTo(c, d), d.rShiftTo(1, d)), c.signum() > 0 ? setTimeout(h, 0) : (g > 0 && d.lShiftTo(g, d), setTimeout(function () { 894 | b(d) 895 | }, 0)) 896 | }; 897 | setTimeout(h, 10) 898 | }; 899 | BigInteger.prototype.gcda = b; 900 | var c = function (a, b, c, d) { 901 | if ("number" == typeof b) if (2 > a) this.fromInt(1); else { 902 | this.fromNumber(a, c), this.testBit(a - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this), this.isEven() && this.dAddOffset(1, 0); 903 | var e = this, f = function () { 904 | e.dAddOffset(2, 0), e.bitLength() > a && e.subTo(BigInteger.ONE.shiftLeft(a - 1), e), e.isProbablePrime(b) ? setTimeout(function () { 905 | d() 906 | }, 0) : setTimeout(f, 0) 907 | }; 908 | setTimeout(f, 0) 909 | } else { 910 | var g = new Array, h = 7 & a; 911 | g.length = (a >> 3) + 1, b.nextBytes(g), h > 0 ? g[0] &= (1 << h) - 1 : g[0] = 0, this.fromString(g, 256) 912 | } 913 | }; 914 | BigInteger.prototype.fromNumberAsync = c 915 | }(); 916 | var b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", b64pad = "=", JSX = JSX || {}; 917 | JSX.env = JSX.env || {}; 918 | var L = JSX, OP = Object.prototype, FUNCTION_TOSTRING = "[object Function]", ADD = ["toString", "valueOf"]; 919 | JSX.env.parseUA = function (a) { 920 | var b, c = function (a) { 921 | var b = 0; 922 | return parseFloat(a.replace(/\./g, function () { 923 | return 1 == b++ ? "" : "." 924 | })) 925 | }, d = navigator, e = { 926 | ie: 0, 927 | opera: 0, 928 | gecko: 0, 929 | webkit: 0, 930 | chrome: 0, 931 | mobile: null, 932 | air: 0, 933 | ipad: 0, 934 | iphone: 0, 935 | ipod: 0, 936 | ios: null, 937 | android: 0, 938 | webos: 0, 939 | caja: d && d.cajaVersion, 940 | secure: !1, 941 | os: null 942 | }, f = a || navigator && navigator.userAgent, g = window && window.location, h = g && g.href; 943 | return e.secure = h && 0 === h.toLowerCase().indexOf("https"), f && (/windows|win32/i.test(f) ? e.os = "windows" : /macintosh/i.test(f) ? e.os = "macintosh" : /rhino/i.test(f) && (e.os = "rhino"), /KHTML/.test(f) && (e.webkit = 1), b = f.match(/AppleWebKit\/([^\s]*)/), b && b[1] && (e.webkit = c(b[1]), / Mobile\//.test(f) ? (e.mobile = "Apple", b = f.match(/OS ([^\s]*)/), b && b[1] && (b = c(b[1].replace("_", "."))), e.ios = b, e.ipad = e.ipod = e.iphone = 0, b = f.match(/iPad|iPod|iPhone/), b && b[0] && (e[b[0].toLowerCase()] = e.ios)) : (b = f.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/), b && (e.mobile = b[0]), /webOS/.test(f) && (e.mobile = "WebOS", b = f.match(/webOS\/([^\s]*);/), b && b[1] && (e.webos = c(b[1]))), / Android/.test(f) && (e.mobile = "Android", b = f.match(/Android ([^\s]*);/), b && b[1] && (e.android = c(b[1])))), b = f.match(/Chrome\/([^\s]*)/), b && b[1] ? e.chrome = c(b[1]) : (b = f.match(/AdobeAIR\/([^\s]*)/), b && (e.air = b[0]))), e.webkit || (b = f.match(/Opera[\s\/]([^\s]*)/), b && b[1] ? (e.opera = c(b[1]), b = f.match(/Version\/([^\s]*)/), b && b[1] && (e.opera = c(b[1])), b = f.match(/Opera Mini[^;]*/), b && (e.mobile = b[0])) : (b = f.match(/MSIE\s([^;]*)/), b && b[1] ? e.ie = c(b[1]) : (b = f.match(/Gecko\/([^\s]*)/), b && (e.gecko = 1, b = f.match(/rv:([^\s\)]*)/), b && b[1] && (e.gecko = c(b[1]))))))), e 944 | }, JSX.env.ua = JSX.env.parseUA(), JSX.isFunction = function (a) { 945 | return "function" == typeof a || OP.toString.apply(a) === FUNCTION_TOSTRING 946 | }, JSX._IEEnumFix = JSX.env.ua.ie ? function (a, b) { 947 | var c, d, e; 948 | for (c = 0; c < ADD.length; c += 1) d = ADD[c], e = b[d], L.isFunction(e) && e != OP[d] && (a[d] = e) 949 | } : function () { 950 | }, JSX.extend = function (a, b, c) { 951 | if (!b || !a) throw new Error("extend failed, please check that all dependencies are included."); 952 | var d, e = function () { 953 | }; 954 | if (e.prototype = b.prototype, a.prototype = new e, a.prototype.constructor = a, a.superclass = b.prototype, b.prototype.constructor == OP.constructor && (b.prototype.constructor = b), c) { 955 | for (d in c) L.hasOwnProperty(c, d) && (a.prototype[d] = c[d]); 956 | L._IEEnumFix(a.prototype, c) 957 | } 958 | }, "undefined" != typeof KJUR && KJUR || (KJUR = {}), "undefined" != typeof KJUR.asn1 && KJUR.asn1 || (KJUR.asn1 = {}), KJUR.asn1.ASN1Util = new function () { 959 | this.integerToByteHex = function (a) { 960 | var b = a.toString(16); 961 | return b.length % 2 == 1 && (b = "0" + b), b 962 | }, this.bigIntToMinTwosComplementsHex = function (a) { 963 | var b = a.toString(16); 964 | if ("-" != b.substr(0, 1)) b.length % 2 == 1 ? b = "0" + b : b.match(/^[0-7]/) || (b = "00" + b); 965 | else { 966 | var c = b.substr(1), d = c.length; 967 | d % 2 == 1 ? d += 1 : b.match(/^[0-7]/) || (d += 2); 968 | for (var e = "", f = 0; d > f; f++) e += "f"; 969 | var g = new BigInteger(e, 16), h = g.xor(a).add(BigInteger.ONE); 970 | b = h.toString(16).replace(/^-/, "") 971 | } 972 | return b 973 | }, this.getPEMStringFromHex = function (a, b) { 974 | var c = CryptoJS.enc.Hex.parse(a), d = CryptoJS.enc.Base64.stringify(c), 975 | e = d.replace(/(.{64})/g, "$1\r\n"); 976 | return e = e.replace(/\r\n$/, ""), "-----BEGIN " + b + "-----\r\n" + e + "\r\n-----END " + b + "-----\r\n" 977 | } 978 | }, KJUR.asn1.ASN1Object = function () { 979 | var a = ""; 980 | this.getLengthHexFromValue = function () { 981 | if ("undefined" == typeof this.hV || null == this.hV) throw"this.hV is null or undefined."; 982 | if (this.hV.length % 2 == 1) throw"value hex must be even length: n=" + a.length + ",v=" + this.hV; 983 | var b = this.hV.length / 2, c = b.toString(16); 984 | if (c.length % 2 == 1 && (c = "0" + c), 128 > b) return c; 985 | var d = c.length / 2; 986 | if (d > 15) throw"ASN.1 length too long to represent by 8x: n = " + b.toString(16); 987 | var e = 128 + d; 988 | return e.toString(16) + c 989 | }, this.getEncodedHex = function () { 990 | return (null == this.hTLV || this.isModified) && (this.hV = this.getFreshValueHex(), this.hL = this.getLengthHexFromValue(), this.hTLV = this.hT + this.hL + this.hV, this.isModified = !1), this.hTLV 991 | }, this.getValueHex = function () { 992 | return this.getEncodedHex(), this.hV 993 | }, this.getFreshValueHex = function () { 994 | return "" 995 | } 996 | }, KJUR.asn1.DERAbstractString = function (a) { 997 | KJUR.asn1.DERAbstractString.superclass.constructor.call(this); 998 | this.getString = function () { 999 | return this.s 1000 | }, this.setString = function (a) { 1001 | this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(this.s) 1002 | }, this.setStringHex = function (a) { 1003 | this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a 1004 | }, this.getFreshValueHex = function () { 1005 | return this.hV 1006 | }, "undefined" != typeof a && ("undefined" != typeof a.str ? this.setString(a.str) : "undefined" != typeof a.hex && this.setStringHex(a.hex)) 1007 | }, JSX.extend(KJUR.asn1.DERAbstractString, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractTime = function () { 1008 | KJUR.asn1.DERAbstractTime.superclass.constructor.call(this); 1009 | this.localDateToUTC = function (a) { 1010 | utc = a.getTime() + 6e4 * a.getTimezoneOffset(); 1011 | var b = new Date(utc); 1012 | return b 1013 | }, this.formatDate = function (a, b) { 1014 | var c = this.zeroPadding, d = this.localDateToUTC(a), e = String(d.getFullYear()); 1015 | "utc" == b && (e = e.substr(2, 2)); 1016 | var f = c(String(d.getMonth() + 1), 2), g = c(String(d.getDate()), 2), h = c(String(d.getHours()), 2), 1017 | i = c(String(d.getMinutes()), 2), j = c(String(d.getSeconds()), 2); 1018 | return e + f + g + h + i + j + "Z" 1019 | }, this.zeroPadding = function (a, b) { 1020 | return a.length >= b ? a : new Array(b - a.length + 1).join("0") + a 1021 | }, this.getString = function () { 1022 | return this.s 1023 | }, this.setString = function (a) { 1024 | this.hTLV = null, this.isModified = !0, this.s = a, this.hV = stohex(this.s) 1025 | }, this.setByDateValue = function (a, b, c, d, e, f) { 1026 | var g = new Date(Date.UTC(a, b - 1, c, d, e, f, 0)); 1027 | this.setByDate(g) 1028 | }, this.getFreshValueHex = function () { 1029 | return this.hV 1030 | } 1031 | }, JSX.extend(KJUR.asn1.DERAbstractTime, KJUR.asn1.ASN1Object), KJUR.asn1.DERAbstractStructured = function (a) { 1032 | KJUR.asn1.DERAbstractString.superclass.constructor.call(this); 1033 | this.setByASN1ObjectArray = function (a) { 1034 | this.hTLV = null, this.isModified = !0, this.asn1Array = a 1035 | }, this.appendASN1Object = function (a) { 1036 | this.hTLV = null, this.isModified = !0, this.asn1Array.push(a) 1037 | }, this.asn1Array = new Array, "undefined" != typeof a && "undefined" != typeof a.array && (this.asn1Array = a.array) 1038 | }, JSX.extend(KJUR.asn1.DERAbstractStructured, KJUR.asn1.ASN1Object), KJUR.asn1.DERBoolean = function () { 1039 | KJUR.asn1.DERBoolean.superclass.constructor.call(this), this.hT = "01", this.hTLV = "0101ff" 1040 | }, JSX.extend(KJUR.asn1.DERBoolean, KJUR.asn1.ASN1Object), KJUR.asn1.DERInteger = function (a) { 1041 | KJUR.asn1.DERInteger.superclass.constructor.call(this), this.hT = "02", this.setByBigInteger = function (a) { 1042 | this.hTLV = null, this.isModified = !0, this.hV = KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(a) 1043 | }, this.setByInteger = function (a) { 1044 | var b = new BigInteger(String(a), 10); 1045 | this.setByBigInteger(b) 1046 | }, this.setValueHex = function (a) { 1047 | this.hV = a 1048 | }, this.getFreshValueHex = function () { 1049 | return this.hV 1050 | }, "undefined" != typeof a && ("undefined" != typeof a.bigint ? this.setByBigInteger(a.bigint) : "undefined" != typeof a["int"] ? this.setByInteger(a["int"]) : "undefined" != typeof a.hex && this.setValueHex(a.hex)) 1051 | }, JSX.extend(KJUR.asn1.DERInteger, KJUR.asn1.ASN1Object), KJUR.asn1.DERBitString = function (a) { 1052 | KJUR.asn1.DERBitString.superclass.constructor.call(this), this.hT = "03", this.setHexValueIncludingUnusedBits = function (a) { 1053 | this.hTLV = null, this.isModified = !0, this.hV = a 1054 | }, this.setUnusedBitsAndHexValue = function (a, b) { 1055 | if (0 > a || a > 7) throw"unused bits shall be from 0 to 7: u = " + a; 1056 | var c = "0" + a; 1057 | this.hTLV = null, this.isModified = !0, this.hV = c + b 1058 | }, this.setByBinaryString = function (a) { 1059 | a = a.replace(/0+$/, ""); 1060 | var b = 8 - a.length % 8; 1061 | 8 == b && (b = 0); 1062 | for (var c = 0; b >= c; c++) a += "0"; 1063 | for (var d = "", c = 0; c < a.length - 1; c += 8) { 1064 | var e = a.substr(c, 8), f = parseInt(e, 2).toString(16); 1065 | 1 == f.length && (f = "0" + f), d += f 1066 | } 1067 | this.hTLV = null, this.isModified = !0, this.hV = "0" + b + d 1068 | }, this.setByBooleanArray = function (a) { 1069 | for (var b = "", c = 0; c < a.length; c++) b += 1 == a[c] ? "1" : "0"; 1070 | this.setByBinaryString(b) 1071 | }, this.newFalseArray = function (a) { 1072 | for (var b = new Array(a), c = 0; a > c; c++) b[c] = !1; 1073 | return b 1074 | }, this.getFreshValueHex = function () { 1075 | return this.hV 1076 | }, "undefined" != typeof a && ("undefined" != typeof a.hex ? this.setHexValueIncludingUnusedBits(a.hex) : "undefined" != typeof a.bin ? this.setByBinaryString(a.bin) : "undefined" != typeof a.array && this.setByBooleanArray(a.array)) 1077 | }, JSX.extend(KJUR.asn1.DERBitString, KJUR.asn1.ASN1Object), KJUR.asn1.DEROctetString = function (a) { 1078 | KJUR.asn1.DEROctetString.superclass.constructor.call(this, a), this.hT = "04" 1079 | }, JSX.extend(KJUR.asn1.DEROctetString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNull = function () { 1080 | KJUR.asn1.DERNull.superclass.constructor.call(this), this.hT = "05", this.hTLV = "0500" 1081 | }, JSX.extend(KJUR.asn1.DERNull, KJUR.asn1.ASN1Object), KJUR.asn1.DERObjectIdentifier = function (a) { 1082 | var b = function (a) { 1083 | var b = a.toString(16); 1084 | return 1 == b.length && (b = "0" + b), b 1085 | }, c = function (a) { 1086 | var c = "", d = new BigInteger(a, 10), e = d.toString(2), f = 7 - e.length % 7; 1087 | 7 == f && (f = 0); 1088 | for (var g = "", h = 0; f > h; h++) g += "0"; 1089 | e = g + e; 1090 | for (var h = 0; h < e.length - 1; h += 7) { 1091 | var i = e.substr(h, 7); 1092 | h != e.length - 7 && (i = "1" + i), c += b(parseInt(i, 2)) 1093 | } 1094 | return c 1095 | }; 1096 | KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this), this.hT = "06", this.setValueHex = function (a) { 1097 | this.hTLV = null, this.isModified = !0, this.s = null, this.hV = a 1098 | }, this.setValueOidString = function (a) { 1099 | if (!a.match(/^[0-9.]+$/)) throw"malformed oid string: " + a; 1100 | var d = "", e = a.split("."), f = 40 * parseInt(e[0]) + parseInt(e[1]); 1101 | d += b(f), e.splice(0, 2); 1102 | for (var g = 0; g < e.length; g++) d += c(e[g]); 1103 | this.hTLV = null, this.isModified = !0, this.s = null, this.hV = d 1104 | }, this.setValueName = function (a) { 1105 | if ("undefined" == typeof KJUR.asn1.x509.OID.name2oidList[a]) throw"DERObjectIdentifier oidName undefined: " + a; 1106 | var b = KJUR.asn1.x509.OID.name2oidList[a]; 1107 | this.setValueOidString(b) 1108 | }, this.getFreshValueHex = function () { 1109 | return this.hV 1110 | }, "undefined" != typeof a && ("undefined" != typeof a.oid ? this.setValueOidString(a.oid) : "undefined" != typeof a.hex ? this.setValueHex(a.hex) : "undefined" != typeof a.name && this.setValueName(a.name)) 1111 | }, JSX.extend(KJUR.asn1.DERObjectIdentifier, KJUR.asn1.ASN1Object), KJUR.asn1.DERUTF8String = function (a) { 1112 | KJUR.asn1.DERUTF8String.superclass.constructor.call(this, a), this.hT = "0c" 1113 | }, JSX.extend(KJUR.asn1.DERUTF8String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERNumericString = function (a) { 1114 | KJUR.asn1.DERNumericString.superclass.constructor.call(this, a), this.hT = "12" 1115 | }, JSX.extend(KJUR.asn1.DERNumericString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERPrintableString = function (a) { 1116 | KJUR.asn1.DERPrintableString.superclass.constructor.call(this, a), this.hT = "13" 1117 | }, JSX.extend(KJUR.asn1.DERPrintableString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERTeletexString = function (a) { 1118 | KJUR.asn1.DERTeletexString.superclass.constructor.call(this, a), this.hT = "14" 1119 | }, JSX.extend(KJUR.asn1.DERTeletexString, KJUR.asn1.DERAbstractString), KJUR.asn1.DERIA5String = function (a) { 1120 | KJUR.asn1.DERIA5String.superclass.constructor.call(this, a), this.hT = "16" 1121 | }, JSX.extend(KJUR.asn1.DERIA5String, KJUR.asn1.DERAbstractString), KJUR.asn1.DERUTCTime = function (a) { 1122 | KJUR.asn1.DERUTCTime.superclass.constructor.call(this, a), this.hT = "17", this.setByDate = function (a) { 1123 | this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "utc"), this.hV = stohex(this.s) 1124 | }, "undefined" != typeof a && ("undefined" != typeof a.str ? this.setString(a.str) : "undefined" != typeof a.hex ? this.setStringHex(a.hex) : "undefined" != typeof a.date && this.setByDate(a.date)) 1125 | }, JSX.extend(KJUR.asn1.DERUTCTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERGeneralizedTime = function (a) { 1126 | KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this, a), this.hT = "18", this.setByDate = function (a) { 1127 | this.hTLV = null, this.isModified = !0, this.date = a, this.s = this.formatDate(this.date, "gen"), this.hV = stohex(this.s) 1128 | }, "undefined" != typeof a && ("undefined" != typeof a.str ? this.setString(a.str) : "undefined" != typeof a.hex ? this.setStringHex(a.hex) : "undefined" != typeof a.date && this.setByDate(a.date)) 1129 | }, JSX.extend(KJUR.asn1.DERGeneralizedTime, KJUR.asn1.DERAbstractTime), KJUR.asn1.DERSequence = function (a) { 1130 | KJUR.asn1.DERSequence.superclass.constructor.call(this, a), this.hT = "30", this.getFreshValueHex = function () { 1131 | for (var a = "", b = 0; b < this.asn1Array.length; b++) { 1132 | var c = this.asn1Array[b]; 1133 | a += c.getEncodedHex() 1134 | } 1135 | return this.hV = a, this.hV 1136 | } 1137 | }, JSX.extend(KJUR.asn1.DERSequence, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERSet = function (a) { 1138 | KJUR.asn1.DERSet.superclass.constructor.call(this, a), this.hT = "31", this.getFreshValueHex = function () { 1139 | for (var a = new Array, b = 0; b < this.asn1Array.length; b++) { 1140 | var c = this.asn1Array[b]; 1141 | a.push(c.getEncodedHex()) 1142 | } 1143 | return a.sort(), this.hV = a.join(""), this.hV 1144 | } 1145 | }, JSX.extend(KJUR.asn1.DERSet, KJUR.asn1.DERAbstractStructured), KJUR.asn1.DERTaggedObject = function (a) { 1146 | KJUR.asn1.DERTaggedObject.superclass.constructor.call(this), this.hT = "a0", this.hV = "", this.isExplicit = !0, this.asn1Object = null, this.setASN1Object = function (a, b, c) { 1147 | this.hT = b, this.isExplicit = a, this.asn1Object = c, this.isExplicit ? (this.hV = this.asn1Object.getEncodedHex(), this.hTLV = null, this.isModified = !0) : (this.hV = null, this.hTLV = c.getEncodedHex(), this.hTLV = this.hTLV.replace(/^../, b), this.isModified = !1) 1148 | }, this.getFreshValueHex = function () { 1149 | return this.hV 1150 | }, "undefined" != typeof a && ("undefined" != typeof a.tag && (this.hT = a.tag), "undefined" != typeof a.explicit && (this.isExplicit = a.explicit), "undefined" != typeof a.obj && (this.asn1Object = a.obj, this.setASN1Object(this.isExplicit, this.hT, this.asn1Object))) 1151 | }, JSX.extend(KJUR.asn1.DERTaggedObject, KJUR.asn1.ASN1Object), function (a) { 1152 | "use strict"; 1153 | var b, c = {}; 1154 | c.decode = function (c) { 1155 | var d; 1156 | if (b === a) { 1157 | var e = "0123456789ABCDEF", f = " \f\n\r  \u2028\u2029"; 1158 | for (b = [], d = 0; 16 > d; ++d) b[e.charAt(d)] = d; 1159 | for (e = e.toLowerCase(), d = 10; 16 > d; ++d) b[e.charAt(d)] = d; 1160 | for (d = 0; d < f.length; ++d) b[f.charAt(d)] = -1 1161 | } 1162 | var g = [], h = 0, i = 0; 1163 | for (d = 0; d < c.length; ++d) { 1164 | var j = c.charAt(d); 1165 | if ("=" == j) break; 1166 | if (j = b[j], -1 != j) { 1167 | if (j === a) throw"Illegal character at offset " + d; 1168 | h |= j, ++i >= 2 ? (g[g.length] = h, h = 0, i = 0) : h <<= 4 1169 | } 1170 | } 1171 | if (i) throw"Hex encoding incomplete: 4 bits missing"; 1172 | return g 1173 | }, window.Hex = c 1174 | }(), function (a) { 1175 | "use strict"; 1176 | var b, c = {}; 1177 | c.decode = function (c) { 1178 | var d; 1179 | if (b === a) { 1180 | var e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", 1181 | f = "= \f\n\r  \u2028\u2029"; 1182 | for (b = [], d = 0; 64 > d; ++d) b[e.charAt(d)] = d; 1183 | for (d = 0; d < f.length; ++d) b[f.charAt(d)] = -1 1184 | } 1185 | var g = [], h = 0, i = 0; 1186 | for (d = 0; d < c.length; ++d) { 1187 | var j = c.charAt(d); 1188 | if ("=" == j) break; 1189 | if (j = b[j], -1 != j) { 1190 | if (j === a) throw"Illegal character at offset " + d; 1191 | h |= j, ++i >= 4 ? (g[g.length] = h >> 16, g[g.length] = h >> 8 & 255, g[g.length] = 255 & h, h = 0, i = 0) : h <<= 6 1192 | } 1193 | } 1194 | switch (i) { 1195 | case 1: 1196 | throw"Base64 encoding incomplete: at least 2 bits missing"; 1197 | case 2: 1198 | g[g.length] = h >> 10; 1199 | break; 1200 | case 3: 1201 | g[g.length] = h >> 16, g[g.length] = h >> 8 & 255 1202 | } 1203 | return g 1204 | }, c.re = /-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/, c.unarmor = function (a) { 1205 | var b = c.re.exec(a); 1206 | if (b) if (b[1]) a = b[1]; else { 1207 | if (!b[2]) throw"RegExp out of sync"; 1208 | a = b[2] 1209 | } 1210 | return c.decode(a) 1211 | }, window.Base64 = c 1212 | }(), function (a) { 1213 | "use strict"; 1214 | 1215 | function b(a, c) { 1216 | a instanceof b ? (this.enc = a.enc, this.pos = a.pos) : (this.enc = a, this.pos = c) 1217 | } 1218 | 1219 | function c(a, b, c, d, e) { 1220 | this.stream = a, this.header = b, this.length = c, this.tag = d, this.sub = e 1221 | } 1222 | 1223 | var d = 100, e = "…", f = { 1224 | tag: function (a, b) { 1225 | var c = document.createElement(a); 1226 | return c.className = b, c 1227 | }, text: function (a) { 1228 | return document.createTextNode(a) 1229 | } 1230 | }; 1231 | b.prototype.get = function (b) { 1232 | if (b === a && (b = this.pos++), b >= this.enc.length) throw"Requesting byte offset " + b + " on a stream of length " + this.enc.length; 1233 | return this.enc[b] 1234 | }, b.prototype.hexDigits = "0123456789ABCDEF", b.prototype.hexByte = function (a) { 1235 | return this.hexDigits.charAt(a >> 4 & 15) + this.hexDigits.charAt(15 & a) 1236 | }, b.prototype.hexDump = function (a, b, c) { 1237 | for (var d = "", e = a; b > e; ++e) if (d += this.hexByte(this.get(e)), c !== !0) switch (15 & e) { 1238 | case 7: 1239 | d += " "; 1240 | break; 1241 | case 15: 1242 | d += "\n"; 1243 | break; 1244 | default: 1245 | d += " " 1246 | } 1247 | return d 1248 | }, b.prototype.parseStringISO = function (a, b) { 1249 | for (var c = "", d = a; b > d; ++d) c += String.fromCharCode(this.get(d)); 1250 | return c 1251 | }, b.prototype.parseStringUTF = function (a, b) { 1252 | for (var c = "", d = a; b > d;) { 1253 | var e = this.get(d++); 1254 | c += String.fromCharCode(128 > e ? e : e > 191 && 224 > e ? (31 & e) << 6 | 63 & this.get(d++) : (15 & e) << 12 | (63 & this.get(d++)) << 6 | 63 & this.get(d++)) 1255 | } 1256 | return c 1257 | }, b.prototype.parseStringBMP = function (a, b) { 1258 | for (var c = "", d = a; b > d; d += 2) { 1259 | var e = this.get(d), f = this.get(d + 1); 1260 | c += String.fromCharCode((e << 8) + f) 1261 | } 1262 | return c 1263 | }, b.prototype.reTime = /^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/, b.prototype.parseTime = function (a, b) { 1264 | var c = this.parseStringISO(a, b), d = this.reTime.exec(c); 1265 | return d ? (c = d[1] + "-" + d[2] + "-" + d[3] + " " + d[4], d[5] && (c += ":" + d[5], d[6] && (c += ":" + d[6], d[7] && (c += "." + d[7]))), d[8] && (c += " UTC", "Z" != d[8] && (c += d[8], d[9] && (c += ":" + d[9]))), c) : "Unrecognized time: " + c 1266 | }, b.prototype.parseInteger = function (a, b) { 1267 | var c = b - a; 1268 | if (c > 4) { 1269 | c <<= 3; 1270 | var d = this.get(a); 1271 | if (0 === d) c -= 8; else for (; 128 > d;) d <<= 1, --c; 1272 | return "(" + c + " bit)" 1273 | } 1274 | for (var e = 0, f = a; b > f; ++f) e = e << 8 | this.get(f); 1275 | return e 1276 | }, b.prototype.parseBitString = function (a, b) { 1277 | var c = this.get(a), d = (b - a - 1 << 3) - c, e = "(" + d + " bit)"; 1278 | if (20 >= d) { 1279 | var f = c; 1280 | e += " "; 1281 | for (var g = b - 1; g > a; --g) { 1282 | for (var h = this.get(g), i = f; 8 > i; ++i) e += h >> i & 1 ? "1" : "0"; 1283 | f = 0 1284 | } 1285 | } 1286 | return e 1287 | }, b.prototype.parseOctetString = function (a, b) { 1288 | var c = b - a, f = "(" + c + " byte) "; 1289 | c > d && (b = a + d); 1290 | for (var g = a; b > g; ++g) f += this.hexByte(this.get(g)); 1291 | return c > d && (f += e), f 1292 | }, b.prototype.parseOID = function (a, b) { 1293 | for (var c = "", d = 0, e = 0, f = a; b > f; ++f) { 1294 | var g = this.get(f); 1295 | if (d = d << 7 | 127 & g, e += 7, !(128 & g)) { 1296 | if ("" === c) { 1297 | var h = 80 > d ? 40 > d ? 0 : 1 : 2; 1298 | c = h + "." + (d - 40 * h) 1299 | } else c += "." + (e >= 31 ? "bigint" : d); 1300 | d = e = 0 1301 | } 1302 | } 1303 | return c 1304 | }, c.prototype.typeName = function () { 1305 | if (this.tag === a) return "unknown"; 1306 | var b = this.tag >> 6, c = (this.tag >> 5 & 1, 31 & this.tag); 1307 | switch (b) { 1308 | case 0: 1309 | switch (c) { 1310 | case 0: 1311 | return "EOC"; 1312 | case 1: 1313 | return "BOOLEAN"; 1314 | case 2: 1315 | return "INTEGER"; 1316 | case 3: 1317 | return "BIT_STRING"; 1318 | case 4: 1319 | return "OCTET_STRING"; 1320 | case 5: 1321 | return "NULL"; 1322 | case 6: 1323 | return "OBJECT_IDENTIFIER"; 1324 | case 7: 1325 | return "ObjectDescriptor"; 1326 | case 8: 1327 | return "EXTERNAL"; 1328 | case 9: 1329 | return "REAL"; 1330 | case 10: 1331 | return "ENUMERATED"; 1332 | case 11: 1333 | return "EMBEDDED_PDV"; 1334 | case 12: 1335 | return "UTF8String"; 1336 | case 16: 1337 | return "SEQUENCE"; 1338 | case 17: 1339 | return "SET"; 1340 | case 18: 1341 | return "NumericString"; 1342 | case 19: 1343 | return "PrintableString"; 1344 | case 20: 1345 | return "TeletexString"; 1346 | case 21: 1347 | return "VideotexString"; 1348 | case 22: 1349 | return "IA5String"; 1350 | case 23: 1351 | return "UTCTime"; 1352 | case 24: 1353 | return "GeneralizedTime"; 1354 | case 25: 1355 | return "GraphicString"; 1356 | case 26: 1357 | return "VisibleString"; 1358 | case 27: 1359 | return "GeneralString"; 1360 | case 28: 1361 | return "UniversalString"; 1362 | case 30: 1363 | return "BMPString"; 1364 | default: 1365 | return "Universal_" + c.toString(16) 1366 | } 1367 | case 1: 1368 | return "Application_" + c.toString(16); 1369 | case 2: 1370 | return "[" + c + "]"; 1371 | case 3: 1372 | return "Private_" + c.toString(16) 1373 | } 1374 | }, c.prototype.reSeemsASCII = /^[ -~]+$/, c.prototype.content = function () { 1375 | if (this.tag === a) return null; 1376 | var b = this.tag >> 6, c = 31 & this.tag, f = this.posContent(), g = Math.abs(this.length); 1377 | if (0 !== b) { 1378 | if (null !== this.sub) return "(" + this.sub.length + " elem)"; 1379 | var h = this.stream.parseStringISO(f, f + Math.min(g, d)); 1380 | return this.reSeemsASCII.test(h) ? h.substring(0, 2 * d) + (h.length > 2 * d ? e : "") : this.stream.parseOctetString(f, f + g) 1381 | } 1382 | switch (c) { 1383 | case 1: 1384 | return 0 === this.stream.get(f) ? "false" : "true"; 1385 | case 2: 1386 | return this.stream.parseInteger(f, f + g); 1387 | case 3: 1388 | return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseBitString(f, f + g); 1389 | case 4: 1390 | return this.sub ? "(" + this.sub.length + " elem)" : this.stream.parseOctetString(f, f + g); 1391 | case 6: 1392 | return this.stream.parseOID(f, f + g); 1393 | case 16: 1394 | case 17: 1395 | return "(" + this.sub.length + " elem)"; 1396 | case 12: 1397 | return this.stream.parseStringUTF(f, f + g); 1398 | case 18: 1399 | case 19: 1400 | case 20: 1401 | case 21: 1402 | case 22: 1403 | case 26: 1404 | return this.stream.parseStringISO(f, f + g); 1405 | case 30: 1406 | return this.stream.parseStringBMP(f, f + g); 1407 | case 23: 1408 | case 24: 1409 | return this.stream.parseTime(f, f + g) 1410 | } 1411 | return null 1412 | }, c.prototype.toString = function () { 1413 | return this.typeName() + "@" + this.stream.pos + "[header:" + this.header + ",length:" + this.length + ",sub:" + (null === this.sub ? "null" : this.sub.length) + "]" 1414 | }, c.prototype.print = function (b) { 1415 | if (b === a && (b = ""), document.writeln(b + this), null !== this.sub) { 1416 | b += " "; 1417 | for (var c = 0, d = this.sub.length; d > c; ++c) this.sub[c].print(b) 1418 | } 1419 | }, c.prototype.toPrettyString = function (b) { 1420 | b === a && (b = ""); 1421 | var c = b + this.typeName() + " @" + this.stream.pos; 1422 | if (this.length >= 0 && (c += "+"), c += this.length, 32 & this.tag ? c += " (constructed)" : 3 != this.tag && 4 != this.tag || null === this.sub || (c += " (encapsulates)"), c += "\n", null !== this.sub) { 1423 | b += " "; 1424 | for (var d = 0, e = this.sub.length; e > d; ++d) c += this.sub[d].toPrettyString(b) 1425 | } 1426 | return c 1427 | }, c.prototype.toDOM = function () { 1428 | var a = f.tag("div", "node"); 1429 | a.asn1 = this; 1430 | var b = f.tag("div", "head"), c = this.typeName().replace(/_/g, " "); 1431 | b.innerHTML = c; 1432 | var d = this.content(); 1433 | if (null !== d) { 1434 | d = String(d).replace(/", c += "Length: " + this.header + "+", c += this.length >= 0 ? this.length : -this.length + " (undefined)", 32 & this.tag ? c += "
(constructed)" : 3 != this.tag && 4 != this.tag || null === this.sub || (c += "
(encapsulates)"), null !== d && (c += "
Value:
" + d + "", "object" == typeof oids && 6 == this.tag)) { 1441 | var h = oids[d]; 1442 | h && (h.d && (c += "
" + h.d), h.c && (c += "
" + h.c), h.w && (c += "
(warning!)")) 1443 | } 1444 | g.innerHTML = c, a.appendChild(g); 1445 | var i = f.tag("div", "sub"); 1446 | if (null !== this.sub) for (var j = 0, k = this.sub.length; k > j; ++j) i.appendChild(this.sub[j].toDOM()); 1447 | return a.appendChild(i), b.onclick = function () { 1448 | a.className = "node collapsed" == a.className ? "node" : "node collapsed" 1449 | }, a 1450 | }, c.prototype.posStart = function () { 1451 | return this.stream.pos 1452 | }, c.prototype.posContent = function () { 1453 | return this.stream.pos + this.header 1454 | }, c.prototype.posEnd = function () { 1455 | return this.stream.pos + this.header + Math.abs(this.length) 1456 | }, c.prototype.fakeHover = function (a) { 1457 | this.node.className += " hover", a && (this.head.className += " hover") 1458 | }, c.prototype.fakeOut = function (a) { 1459 | var b = / ?hover/; 1460 | this.node.className = this.node.className.replace(b, ""), a && (this.head.className = this.head.className.replace(b, "")) 1461 | }, c.prototype.toHexDOM_sub = function (a, b, c, d, e) { 1462 | if (!(d >= e)) { 1463 | var g = f.tag("span", b); 1464 | g.appendChild(f.text(c.hexDump(d, e))), a.appendChild(g) 1465 | } 1466 | }, c.prototype.toHexDOM = function (b) { 1467 | var c = f.tag("span", "hex"); 1468 | if (b === a && (b = c), this.head.hexNode = c, this.head.onmouseover = function () { 1469 | this.hexNode.className = "hexCurrent" 1470 | }, this.head.onmouseout = function () { 1471 | this.hexNode.className = "hex" 1472 | }, c.asn1 = this, c.onmouseover = function () { 1473 | var a = !b.selected; 1474 | a && (b.selected = this.asn1, this.className = "hexCurrent"), this.asn1.fakeHover(a) 1475 | }, c.onmouseout = function () { 1476 | var a = b.selected == this.asn1; 1477 | this.asn1.fakeOut(a), a && (b.selected = null, this.className = "hex") 1478 | }, this.toHexDOM_sub(c, "tag", this.stream, this.posStart(), this.posStart() + 1), this.toHexDOM_sub(c, this.length >= 0 ? "dlen" : "ulen", this.stream, this.posStart() + 1, this.posContent()), null === this.sub) c.appendChild(f.text(this.stream.hexDump(this.posContent(), this.posEnd()))); else if (this.sub.length > 0) { 1479 | var d = this.sub[0], e = this.sub[this.sub.length - 1]; 1480 | this.toHexDOM_sub(c, "intro", this.stream, this.posContent(), d.posStart()); 1481 | for (var g = 0, h = this.sub.length; h > g; ++g) c.appendChild(this.sub[g].toHexDOM(b)); 1482 | this.toHexDOM_sub(c, "outro", this.stream, e.posEnd(), this.posEnd()) 1483 | } 1484 | return c 1485 | }, c.prototype.toHexString = function () { 1486 | return this.stream.hexDump(this.posStart(), this.posEnd(), !0) 1487 | }, c.decodeLength = function (a) { 1488 | var b = a.get(), c = 127 & b; 1489 | if (c == b) return c; 1490 | if (c > 3) throw"Length over 24 bits not supported at position " + (a.pos - 1); 1491 | if (0 === c) return -1; 1492 | b = 0; 1493 | for (var d = 0; c > d; ++d) b = b << 8 | a.get(); 1494 | return b 1495 | }, c.hasContent = function (a, d, e) { 1496 | if (32 & a) return !0; 1497 | if (3 > a || a > 4) return !1; 1498 | var f = new b(e); 1499 | 3 == a && f.get(); 1500 | var g = f.get(); 1501 | if (g >> 6 & 1) return !1; 1502 | try { 1503 | var h = c.decodeLength(f); 1504 | return f.pos - e.pos + h == d 1505 | } catch (i) { 1506 | return !1 1507 | } 1508 | }, c.decode = function (a) { 1509 | a instanceof b || (a = new b(a, 0)); 1510 | var d = new b(a), e = a.get(), f = c.decodeLength(a), g = a.pos - d.pos, h = null; 1511 | if (c.hasContent(e, f, a)) { 1512 | var i = a.pos; 1513 | if (3 == e && a.get(), h = [], f >= 0) { 1514 | for (var j = i + f; a.pos < j;) h[h.length] = c.decode(a); 1515 | if (a.pos != j) throw"Content size is not correct for container starting at offset " + i 1516 | } else try { 1517 | for (; ;) { 1518 | var k = c.decode(a); 1519 | if (0 === k.tag) break; 1520 | h[h.length] = k 1521 | } 1522 | f = i - a.pos 1523 | } catch (l) { 1524 | throw"Exception while decoding undefined length content: " + l 1525 | } 1526 | } else a.pos += f; 1527 | return new c(d, g, f, e, h) 1528 | }, c.test = function () { 1529 | for (var a = [{value: [39], expected: 39}, {value: [129, 201], expected: 201}, { 1530 | value: [131, 254, 220, 186], 1531 | expected: 16702650 1532 | }], d = 0, e = a.length; e > d; ++d) { 1533 | var f = new b(a[d].value, 0), g = c.decodeLength(f); 1534 | g != a[d].expected && document.write("In test[" + d + "] expected " + a[d].expected + " got " + g + "\n") 1535 | } 1536 | }, window.ASN1 = c 1537 | }(), ASN1.prototype.getHexStringValue = function () { 1538 | var a = this.toHexString(), b = 2 * this.header, c = 2 * this.length; 1539 | return a.substr(b, c) 1540 | }, RSAKey.prototype.parseKey = function (a) { 1541 | try { 1542 | var b = 0, c = 0, d = /^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/, 1543 | e = d.test(a) ? Hex.decode(a) : Base64.unarmor(a), f = ASN1.decode(e); 1544 | if (3 === f.sub.length && (f = f.sub[2].sub[0]), 9 === f.sub.length) { 1545 | b = f.sub[1].getHexStringValue(), this.n = parseBigInt(b, 16), c = f.sub[2].getHexStringValue(), this.e = parseInt(c, 16); 1546 | var g = f.sub[3].getHexStringValue(); 1547 | this.d = parseBigInt(g, 16); 1548 | var h = f.sub[4].getHexStringValue(); 1549 | this.p = parseBigInt(h, 16); 1550 | var i = f.sub[5].getHexStringValue(); 1551 | this.q = parseBigInt(i, 16); 1552 | var j = f.sub[6].getHexStringValue(); 1553 | this.dmp1 = parseBigInt(j, 16); 1554 | var k = f.sub[7].getHexStringValue(); 1555 | this.dmq1 = parseBigInt(k, 16); 1556 | var l = f.sub[8].getHexStringValue(); 1557 | this.coeff = parseBigInt(l, 16) 1558 | } else { 1559 | if (2 !== f.sub.length) return !1; 1560 | var m = f.sub[1], n = m.sub[0]; 1561 | b = n.sub[0].getHexStringValue(), this.n = parseBigInt(b, 16), c = n.sub[1].getHexStringValue(), this.e = parseInt(c, 16) 1562 | } 1563 | return !0 1564 | } catch (o) { 1565 | return !1 1566 | } 1567 | }, RSAKey.prototype.getPrivateBaseKey = function () { 1568 | var a = {array: [new KJUR.asn1.DERInteger({"int": 0}), new KJUR.asn1.DERInteger({bigint: this.n}), new KJUR.asn1.DERInteger({"int": this.e}), new KJUR.asn1.DERInteger({bigint: this.d}), new KJUR.asn1.DERInteger({bigint: this.p}), new KJUR.asn1.DERInteger({bigint: this.q}), new KJUR.asn1.DERInteger({bigint: this.dmp1}), new KJUR.asn1.DERInteger({bigint: this.dmq1}), new KJUR.asn1.DERInteger({bigint: this.coeff})]}, 1569 | b = new KJUR.asn1.DERSequence(a); 1570 | return b.getEncodedHex() 1571 | }, RSAKey.prototype.getPrivateBaseKeyB64 = function () { 1572 | return hex2b64(this.getPrivateBaseKey()) 1573 | }, RSAKey.prototype.getPublicBaseKey = function () { 1574 | var a = {array: [new KJUR.asn1.DERObjectIdentifier({oid: "1.2.840.113549.1.1.1"}), new KJUR.asn1.DERNull]}, 1575 | b = new KJUR.asn1.DERSequence(a); 1576 | a = {array: [new KJUR.asn1.DERInteger({bigint: this.n}), new KJUR.asn1.DERInteger({"int": this.e})]}; 1577 | var c = new KJUR.asn1.DERSequence(a); 1578 | a = {hex: "00" + c.getEncodedHex()}; 1579 | var d = new KJUR.asn1.DERBitString(a); 1580 | a = {array: [b, d]}; 1581 | var e = new KJUR.asn1.DERSequence(a); 1582 | return e.getEncodedHex() 1583 | }, RSAKey.prototype.getPublicBaseKeyB64 = function () { 1584 | return hex2b64(this.getPublicBaseKey()) 1585 | }, RSAKey.prototype.wordwrap = function (a, b) { 1586 | if (b = b || 64, !a) return a; 1587 | var c = "(.{1," + b + "})( +|$\n?)|(.{1," + b + "})"; 1588 | return a.match(RegExp(c, "g")).join("\n") 1589 | }, RSAKey.prototype.getPrivateKey = function () { 1590 | var a = "-----BEGIN RSA PRIVATE KEY-----\n"; 1591 | return a += this.wordwrap(this.getPrivateBaseKeyB64()) + "\n", a += "-----END RSA PRIVATE KEY-----" 1592 | }, RSAKey.prototype.getPublicKey = function () { 1593 | var a = "-----BEGIN PUBLIC KEY-----\n"; 1594 | return a += this.wordwrap(this.getPublicBaseKeyB64()) + "\n", a += "-----END PUBLIC KEY-----" 1595 | }, RSAKey.prototype.hasPublicKeyProperty = function (a) { 1596 | return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e") 1597 | }, RSAKey.prototype.hasPrivateKeyProperty = function (a) { 1598 | return a = a || {}, a.hasOwnProperty("n") && a.hasOwnProperty("e") && a.hasOwnProperty("d") && a.hasOwnProperty("p") && a.hasOwnProperty("q") && a.hasOwnProperty("dmp1") && a.hasOwnProperty("dmq1") && a.hasOwnProperty("coeff") 1599 | }, RSAKey.prototype.parsePropertiesFrom = function (a) { 1600 | this.n = a.n, this.e = a.e, a.hasOwnProperty("d") && (this.d = a.d, this.p = a.p, this.q = a.q, this.dmp1 = a.dmp1, this.dmq1 = a.dmq1, this.coeff = a.coeff) 1601 | }; 1602 | var JSEncryptRSAKey = function (a) { 1603 | RSAKey.call(this), a && ("string" == typeof a ? this.parseKey(a) : (this.hasPrivateKeyProperty(a) || this.hasPublicKeyProperty(a)) && this.parsePropertiesFrom(a)) 1604 | }; 1605 | JSEncryptRSAKey.prototype = new RSAKey, JSEncryptRSAKey.prototype.constructor = JSEncryptRSAKey; 1606 | var JSEncrypt = function (a) { 1607 | a = a || {}, this.default_key_size = parseInt(a.default_key_size) || 1024, this.default_public_exponent = a.default_public_exponent || "010001", this.log = a.log || !1, this.key = null 1608 | }; 1609 | JSEncrypt.prototype.setKey = function (a) { 1610 | this.log && this.key && console.warn("A key was already set, overriding existing."), this.key = new JSEncryptRSAKey(a) 1611 | }, JSEncrypt.prototype.setPrivateKey = function (a) { 1612 | this.setKey(a) 1613 | }, JSEncrypt.prototype.setPublicKey = function (a) { 1614 | this.setKey(a) 1615 | }, JSEncrypt.prototype.decrypt = function (a) { 1616 | try { 1617 | return this.getKey().decrypt(b64tohex(a)) 1618 | } catch (b) { 1619 | return !1 1620 | } 1621 | }, JSEncrypt.prototype.encrypt = function (a) { 1622 | try { 1623 | return hex2b64(this.getKey().encrypt(a)) 1624 | } catch (b) { 1625 | return !1 1626 | } 1627 | }, JSEncrypt.prototype.getKey = function (a) { 1628 | if (!this.key) { 1629 | if (this.key = new JSEncryptRSAKey, a && "[object Function]" === {}.toString.call(a)) return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, a); 1630 | this.key.generate(this.default_key_size, this.default_public_exponent) 1631 | } 1632 | return this.key 1633 | }, JSEncrypt.prototype.getPrivateKey = function () { 1634 | return this.getKey().getPrivateKey() 1635 | }, JSEncrypt.prototype.getPrivateKeyB64 = function () { 1636 | return this.getKey().getPrivateBaseKeyB64() 1637 | }, JSEncrypt.prototype.getPublicKey = function () { 1638 | return this.getKey().getPublicKey() 1639 | }, JSEncrypt.prototype.getPublicKeyB64 = function () { 1640 | return this.getKey().getPublicBaseKeyB64() 1641 | }; 1642 | exports.JSEncrypt = JSEncrypt; 1643 | })(JSEncryptExports); 1644 | var JSEncrypt = JSEncryptExports.JSEncrypt; 1645 | var KJUR = {} 1646 | export default JSEncrypt -------------------------------------------------------------------------------- /src/static/js/qqmap.js: -------------------------------------------------------------------------------- 1 | window.qq=window.qq||{},qq.maps=qq.maps||{},window.soso||(window.soso=qq),soso.maps||(soso.maps=qq.maps),qq.maps.Geolocation=function(){"use strict";var e=[],t=null,o=0,n="_geoIframe_"+Math.ceil(1e7*Math.random()),i=document.createElement("iframe"),r=null,s=null,a=null,c=null,u=function(u,p){if(!u)return void alert("请输入key!");if(!p)return void alert("请输入referer!");var l=document.getElementById(n);if(!l){i.setAttribute("id",n);var g="https:";i.setAttribute("src",g+"//apis.map.qq.com/tools/geolocation?key="+u+"&referer="+p),i.setAttribute("style","display: none; width: 100%; height: 30%"),document.body?document.body.appendChild(i):document.write(i.outerHTML);var m=this;window.addEventListener("message",function(n){var i=n.data;if(i&&"geolocation"==i.module){if(clearTimeout(c),e.length>0){var u=e.shift();u.sucCb&&u.sucCb(i)}o=2,m.executeNextGeo(),t&&t(i)}else{s=(new Date).getTime();var p=s-r;if(p>=a){if(e.length>0&&"geo"===e[0].type){var u=e.shift(),l={type:"fail",code:5,message:"The request"};u.errCb&&u.errCb(l)}clearTimeout(c),o=-1,m.executeNextGeo()}if(e.length>0&&"ip"===e[0].type){var u=e.shift();u.errCb&&u.errCb(l)}}},!1)}};return u.prototype.executeNextGeo=function(){1!==o&&e.length>0&&(o=1,e[0].geoprocess())},u.prototype.getLocation=function(t,n,i){if(i&&i.timeout){var r=new RegExp("^[0-9]*$");if(!r.test(i.timeout))return void alert("timeout 请输入数字")}if(e.length>10)throw new Error("geolocation queue must be lass than 10");e.push({sucCb:t,errCb:n,option:i,geoprocess:this.getOnceLocation,type:"geo"}),1!==o&&(o=1,this.getOnceLocation())},u.prototype.getOnceLocation=function(){var t=e[0]&&e[0].option;r=(new Date).getTime(),a=t&&t.timeout?+t.timeout:1e4,clearTimeout(c),c=setTimeout(function(){if(e.length>0){var t=e.shift();t.errCb&&t.errCb()}},a),document.getElementById(n).contentWindow.postMessage("getLocation","*")},u.prototype.getIpLocation=function(t,n){if(e.length>10)throw new Error("geolocation queue mast be lass than 10");e.push({sucCb:t,errCb:n,geoprocess:this.getOnceIpLocation,type:"ip"}),1!==o&&(o=1,this.getOnceIpLocation())},u.prototype.getOnceIpLocation=function(){document.getElementById(n).contentWindow.postMessage("getLocation.robust","*")},u.prototype.watchPosition=function(e){t=e,document.getElementById(n).contentWindow.postMessage("watchPosition","*")},u.prototype.clearWatch=function(){t=null,document.getElementById(n).contentWindow.postMessage("clearWatch","*")},u}(); 2 | -------------------------------------------------------------------------------- /src/static/js/utils.js: -------------------------------------------------------------------------------- 1 | const objectAssign = require('object-assign'); 2 | const util = { 3 | install (Vue) { 4 | Vue._util = createUtil(); 5 | Object.defineProperties(Vue.prototype, { 6 | _util: { 7 | get: function () { 8 | return createUtil(); 9 | } 10 | } 11 | }) 12 | } 13 | }; 14 | function createUtil () { 15 | return { 16 | // 渲染城市名 17 | setCityName(params){ 18 | let cityname = '' 19 | switch (params.row.city || params.row.orgId) { 20 | case '01': 21 | cityname = '南京市'; 22 | break; 23 | case '02': 24 | cityname = '苏州市'; 25 | break; 26 | case '03': 27 | cityname = '无锡市'; 28 | break; 29 | case '04': 30 | cityname = '常州市'; 31 | break; 32 | case '05': 33 | cityname = '镇江市'; 34 | break; 35 | case '06': 36 | cityname = '扬州市'; 37 | break; 38 | case '07': 39 | cityname = '南通市'; 40 | break; 41 | case '08': 42 | cityname = '泰州市'; 43 | break; 44 | case '09': 45 | cityname = '徐州市'; 46 | break; 47 | case '10': 48 | cityname = '淮安市'; 49 | break; 50 | case '11': 51 | cityname = '盐城市'; 52 | break; 53 | case '12': 54 | cityname = '连云港市'; 55 | break; 56 | case '13': 57 | cityname = '宿迁市'; 58 | } 59 | return cityname 60 | }, 61 | // 渲染角色名 62 | setRoleName(params){ 63 | let roletype = '' 64 | switch (params.row.type) { 65 | case '0': 66 | roletype = '超级管理员'; 67 | break; 68 | case '1': 69 | roletype = '管理员'; 70 | break; 71 | case '2': 72 | roletype = '操作员'; 73 | break; 74 | case '3': 75 | roletype = '审核员'; 76 | } 77 | return roletype 78 | }, 79 | } 80 | } 81 | export default util; 82 | -------------------------------------------------------------------------------- /src/static/style/global.scss: -------------------------------------------------------------------------------- 1 | // 主题色配置 2 | $theme-color:#4fc08d; 3 | // rem 单位换算:定为 75px 只是方便运算,750px-75px、640-64px、1080px-108px,如此类推 4 | $vw_fontsize: 75; // iPhone 6尺寸的根元素大小基准值 5 | @function rem($px) { 6 | @return ($px / $vw_fontsize ) * 1rem; 7 | } 8 | // 根元素大小使用 vw 单位 9 | $vw_design: 750; 10 | html { 11 | font-size: ($vw_fontsize / ($vw_design / 2)) * 100vw; 12 | // 同时,通过Media Queries 限制根元素最大最小值 13 | @media screen and (max-width: 300px) { 14 | font-size: 64px; 15 | } 16 | @media screen and (min-width: 750px) { 17 | font-size: 108px; 18 | } 19 | } 20 | // body 也增加最大最小宽度限制,避免默认100%宽度的 block 元素跟随 body 而过大过小 21 | body { 22 | max-width: 750px; 23 | min-width: 300px; 24 | } 25 | 26 | 27 | 28 | // 29 | //// mand-mobile 30 | // 31 | //// form 32 | //.md-field{ 33 | // padding:0; 34 | // margin: 0; 35 | //} 36 | //.md-field-item-title,.md-field-item-control{ 37 | // font-size: rem(18); 38 | //} 39 | //.md-field-item-right .md-icon.icon-font.md{ 40 | // font-size: rem(16); 41 | //} 42 | //.md-field-item-content{ 43 | // min-height: inherit; 44 | // padding:rem(20) rem(10); 45 | //} -------------------------------------------------------------------------------- /src/static/style/mix.scss: -------------------------------------------------------------------------------- 1 | @mixin bg($positon:center,$size:cover) { 2 | background-position: $positon; 3 | background-size: $size; 4 | background-repeat: no-repeat; 5 | } 6 | @mixin flex($dire:row,$just:center,$aligh:center) { 7 | display: flex; 8 | flex-direction: $dire; 9 | justify-content: $just; 10 | align-items: $aligh; 11 | } 12 | 13 | @mixin ab($top:0,$right:0,$bottom:0,$left:0){ 14 | position: absolute; 15 | top: $top; 16 | right: $right; 17 | bottom: $bottom; 18 | left: $left 19 | } 20 | @mixin trans_center() { 21 | position: absolute; 22 | top: 50%; 23 | left: 50%; 24 | transform: translate(-50%,-50%); 25 | } -------------------------------------------------------------------------------- /src/static/style/nomal.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /* Document 4 | ========================================================================== */ 5 | 6 | /** 7 | * 1. Correct the line height in all browsers. 8 | * 2. Prevent adjustments of font size after orientation changes in iOS. 9 | */ 10 | 11 | html { 12 | background: #F1F1F1; 13 | line-height: 1.15; /* 1 */ 14 | -webkit-text-size-adjust: 100%; /* 2 */ 15 | } 16 | 17 | /* Sections 18 | ========================================================================== */ 19 | 20 | /** 21 | * Remove the margin in all browsers. 22 | */ 23 | 24 | body { 25 | margin: 0; 26 | } 27 | 28 | /** 29 | * Render the `main` element consistently in IE. 30 | */ 31 | 32 | main { 33 | display: block; 34 | } 35 | 36 | /** 37 | * Correct the font size and margin on `h1` elements within `section` and 38 | * `article` contexts in Chrome, Firefox, and Safari. 39 | */ 40 | 41 | h1 { 42 | font-size: 2em; 43 | margin: 0.67em 0; 44 | } 45 | 46 | /* Grouping content 47 | ========================================================================== */ 48 | 49 | /** 50 | * 1. Add the correct box sizing in Firefox. 51 | * 2. Show the overflow in Edge and IE. 52 | */ 53 | 54 | hr { 55 | box-sizing: content-box; /* 1 */ 56 | height: 0; /* 1 */ 57 | overflow: visible; /* 2 */ 58 | } 59 | 60 | /** 61 | * 1. Correct the inheritance and scaling of font size in all browsers. 62 | * 2. Correct the odd `em` font sizing in all browsers. 63 | */ 64 | 65 | pre { 66 | font-family: monospace, monospace; /* 1 */ 67 | font-size: 1em; /* 2 */ 68 | } 69 | 70 | /* Text-level semantics 71 | ========================================================================== */ 72 | 73 | /** 74 | * Remove the gray background on active links in IE 10. 75 | */ 76 | 77 | a { 78 | background-color: transparent; 79 | } 80 | 81 | /** 82 | * 1. Remove the bottom border in Chrome 57- 83 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 84 | */ 85 | 86 | abbr[title] { 87 | border-bottom: none; /* 1 */ 88 | text-decoration: underline; /* 2 */ 89 | text-decoration: underline dotted; /* 2 */ 90 | } 91 | 92 | /** 93 | * Add the correct font weight in Chrome, Edge, and Safari. 94 | */ 95 | 96 | b, 97 | strong { 98 | font-weight: bolder; 99 | } 100 | 101 | /** 102 | * 1. Correct the inheritance and scaling of font size in all browsers. 103 | * 2. Correct the odd `em` font sizing in all browsers. 104 | */ 105 | 106 | code, 107 | kbd, 108 | samp { 109 | font-family: monospace, monospace; /* 1 */ 110 | font-size: 1em; /* 2 */ 111 | } 112 | 113 | /** 114 | * Add the correct font size in all browsers. 115 | */ 116 | 117 | small { 118 | font-size: 80%; 119 | } 120 | 121 | /** 122 | * Prevent `sub` and `sup` elements from affecting the line height in 123 | * all browsers. 124 | */ 125 | 126 | sub, 127 | sup { 128 | font-size: 75%; 129 | line-height: 0; 130 | position: relative; 131 | vertical-align: baseline; 132 | } 133 | 134 | sub { 135 | bottom: -0.25em; 136 | } 137 | 138 | sup { 139 | top: -0.5em; 140 | } 141 | 142 | /* Embedded content 143 | ========================================================================== */ 144 | 145 | /** 146 | * Remove the border on images inside links in IE 10. 147 | */ 148 | 149 | img { 150 | border-style: none; 151 | } 152 | 153 | /* Forms 154 | ========================================================================== */ 155 | 156 | /** 157 | * 1. Change the font styles in all browsers. 158 | * 2. Remove the margin in Firefox and Safari. 159 | */ 160 | 161 | button, 162 | input, 163 | optgroup, 164 | select, 165 | textarea { 166 | font-family: inherit; /* 1 */ 167 | font-size: 100%; /* 1 */ 168 | line-height: 1.15; /* 1 */ 169 | margin: 0; /* 2 */ 170 | } 171 | 172 | /** 173 | * Show the overflow in IE. 174 | * 1. Show the overflow in Edge. 175 | */ 176 | 177 | button, 178 | input { /* 1 */ 179 | overflow: visible; 180 | } 181 | 182 | /** 183 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 184 | * 1. Remove the inheritance of text transform in Firefox. 185 | */ 186 | 187 | button, 188 | select { /* 1 */ 189 | text-transform: none; 190 | } 191 | 192 | /** 193 | * Correct the inability to style clickable types in iOS and Safari. 194 | */ 195 | 196 | button, 197 | [type="button"], 198 | [type="reset"], 199 | [type="submit"] { 200 | -webkit-appearance: button; 201 | } 202 | 203 | /** 204 | * Remove the inner border and padding in Firefox. 205 | */ 206 | 207 | button::-moz-focus-inner, 208 | [type="button"]::-moz-focus-inner, 209 | [type="reset"]::-moz-focus-inner, 210 | [type="submit"]::-moz-focus-inner { 211 | border-style: none; 212 | padding: 0; 213 | } 214 | 215 | /** 216 | * Restore the focus styles unset by the previous rule. 217 | */ 218 | 219 | button:-moz-focusring, 220 | [type="button"]:-moz-focusring, 221 | [type="reset"]:-moz-focusring, 222 | [type="submit"]:-moz-focusring { 223 | outline: 1px dotted ButtonText; 224 | } 225 | 226 | /** 227 | * Correct the padding in Firefox. 228 | */ 229 | 230 | fieldset { 231 | padding: 0.35em 0.75em 0.625em; 232 | } 233 | 234 | /** 235 | * 1. Correct the text wrapping in Edge and IE. 236 | * 2. Correct the color inheritance from `fieldset` elements in IE. 237 | * 3. Remove the padding so developers are not caught out when they zero out 238 | * `fieldset` elements in all browsers. 239 | */ 240 | 241 | legend { 242 | box-sizing: border-box; /* 1 */ 243 | color: inherit; /* 2 */ 244 | display: table; /* 1 */ 245 | max-width: 100%; /* 1 */ 246 | padding: 0; /* 3 */ 247 | white-space: normal; /* 1 */ 248 | } 249 | 250 | /** 251 | * Add the correct vertical alignment in Chrome, Firefox, and Opera. 252 | */ 253 | 254 | progress { 255 | vertical-align: baseline; 256 | } 257 | 258 | /** 259 | * Remove the default vertical scrollbar in IE 10+. 260 | */ 261 | 262 | textarea { 263 | overflow: auto; 264 | } 265 | 266 | /** 267 | * 1. Add the correct box sizing in IE 10. 268 | * 2. Remove the padding in IE 10. 269 | */ 270 | 271 | [type="checkbox"], 272 | [type="radio"] { 273 | box-sizing: border-box; /* 1 */ 274 | padding: 0; /* 2 */ 275 | } 276 | 277 | /** 278 | * Correct the cursor style of increment and decrement buttons in Chrome. 279 | */ 280 | 281 | [type="number"]::-webkit-inner-spin-button, 282 | [type="number"]::-webkit-outer-spin-button { 283 | height: auto; 284 | } 285 | 286 | /** 287 | * 1. Correct the odd appearance in Chrome and Safari. 288 | * 2. Correct the outline style in Safari. 289 | */ 290 | 291 | [type="search"] { 292 | -webkit-appearance: textfield; /* 1 */ 293 | outline-offset: -2px; /* 2 */ 294 | } 295 | 296 | /** 297 | * Remove the inner padding in Chrome and Safari on macOS. 298 | */ 299 | 300 | [type="search"]::-webkit-search-decoration { 301 | -webkit-appearance: none; 302 | } 303 | 304 | /** 305 | * 1. Correct the inability to style clickable types in iOS and Safari. 306 | * 2. Change font properties to `inherit` in Safari. 307 | */ 308 | 309 | ::-webkit-file-upload-button { 310 | -webkit-appearance: button; /* 1 */ 311 | font: inherit; /* 2 */ 312 | } 313 | 314 | /* Interactive 315 | ========================================================================== */ 316 | 317 | /* 318 | * Add the correct display in Edge, IE 10+, and Firefox. 319 | */ 320 | 321 | details { 322 | display: block; 323 | } 324 | 325 | /* 326 | * Add the correct display in all browsers. 327 | */ 328 | 329 | summary { 330 | display: list-item; 331 | } 332 | 333 | /* Misc 334 | ========================================================================== */ 335 | 336 | /** 337 | * Add the correct display in IE 10+. 338 | */ 339 | 340 | template { 341 | display: none; 342 | } 343 | 344 | /** 345 | * Add the correct display in IE 10. 346 | */ 347 | 348 | [hidden] { 349 | display: none; 350 | } 351 | 352 | ul,li{ 353 | margin: 0; 354 | padding: 0; 355 | } -------------------------------------------------------------------------------- /src/store/index.js: -------------------------------------------------------------------------------- 1 | import createPersistedState from 'vuex-persistedstate' 2 | import Vue from 'vue' 3 | import Vuex from 'vuex' 4 | // 用户信息模块 5 | import demo from './modules/demo'; 6 | Vue.use(Vuex) 7 | export default new Vuex.Store({ 8 | state: { 9 | loading:false 10 | }, 11 | mutations: { 12 | 13 | }, 14 | actions: { 15 | 16 | }, 17 | modules: { 18 | demo, 19 | }, 20 | plugins: [createPersistedState({ 21 | // vuex持久化插件 22 | storage: window.sessionStorage 23 | })] 24 | }) 25 | -------------------------------------------------------------------------------- /src/store/modules/demo.js: -------------------------------------------------------------------------------- 1 | const demo = { 2 | state: { 3 | demoId: '' 4 | }, 5 | mutations: { 6 | set_demo_id (state ,v) { 7 | state.demoId = v 8 | }, 9 | }, 10 | actions: { 11 | 12 | }, 13 | getters: { 14 | demoId: state => state.demoId, 15 | } 16 | }; 17 | export default demo; 18 | -------------------------------------------------------------------------------- /src/views/demo/detail/index.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 25 | 26 | -------------------------------------------------------------------------------- /src/views/demo/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 33 | 34 | -------------------------------------------------------------------------------- /src/views/demo/route.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by lzy on 2019/4/16 3 | */ 4 | const Demo=() => import(/* webpackChunkName: "demo-page" */ '@views/demo/index') 5 | const DemoDetail =() => import(/* webpackChunkName: "demo-page" */ '@views/demo/detail/index') 6 | 7 | const DEMO_ROUTERS =[ 8 | { 9 | path: '/demo', 10 | name: '订单1', 11 | component: Demo, 12 | meta: {requireAuth: false,index:1}, 13 | }, 14 | { 15 | path: '/detail', 16 | name: '订单详情', 17 | component: DemoDetail, 18 | meta: {requireAuth: false,index:2}, 19 | }, 20 | ] 21 | 22 | export default DEMO_ROUTERS 23 | -------------------------------------------------------------------------------- /src/views/home/index.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 53 | 54 | -------------------------------------------------------------------------------- /src/views/home/route.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by lzy on 2019/4/15 3 | */ 4 | const Home =() => import(/* webpackChunkName: "home-page" */ '@views/home/index'); 5 | 6 | const HOME_ROUTERS =[ 7 | { 8 | path: '/home', 9 | name: '首页', 10 | component: Home, 11 | meta: {requireAuth: false,index:0,}, 12 | } 13 | ] 14 | 15 | export default HOME_ROUTERS 16 | -------------------------------------------------------------------------------- /src/views/layout/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 37 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | module.exports = { 3 | // baseUrl:'/jiangsu/testentrance/sjfhtest/web/', 4 | lintOnSave: true, 5 | chainWebpack: (config)=>{ 6 | config.resolve.alias 7 | .set('@', resolve('src')) 8 | .set('@as',resolve('src/assets')) 9 | .set('@cp',resolve('src/components')) 10 | .set('@service',resolve('src/service')) 11 | .set('@static',resolve('src/static')) 12 | .set('@views',resolve('src/views')) 13 | const types = ['vue-modules', 'vue', 'normal-modules', 'normal'] 14 | types.forEach(type => addStyleResource(config.module.rule('scss').oneOf(type))) 15 | }, 16 | } 17 | // alias 18 | function resolve (dir) { 19 | return path.join(__dirname, dir) 20 | } 21 | // 全局引入mixin 22 | function addStyleResource (rule) { 23 | rule.use('style-resource') 24 | .loader('style-resources-loader') 25 | .options({ 26 | patterns: [ 27 | path.resolve(__dirname, './src/static/style/mix.scss'), 28 | path.resolve(__dirname, './src/static/style/global.scss'), 29 | ], 30 | })} 31 | --------------------------------------------------------------------------------