正在显示
7 个修改的文件
包含
91 行增加
和
96 行删除
| ... | @@ -4187,9 +4187,9 @@ | ... | @@ -4187,9 +4187,9 @@ |
| 4187 | "dev": true | 4187 | "dev": true |
| 4188 | }, | 4188 | }, |
| 4189 | "css-loader": { | 4189 | "css-loader": { |
| 4190 | - "version": "3.4.0", | 4190 | + "version": "3.4.1", |
| 4191 | - "resolved": "https://registry.npm.taobao.org/css-loader/download/css-loader-3.4.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-loader%2Fdownload%2Fcss-loader-3.4.0.tgz", | 4191 | + "resolved": "https://registry.npm.taobao.org/css-loader/download/css-loader-3.4.1.tgz?cache=0&sync_timestamp=1578065938051&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcss-loader%2Fdownload%2Fcss-loader-3.4.1.tgz", |
| 4192 | - "integrity": "sha1-n7JjQ2eDEXpB0BTkXo6uulTdZnA=", | 4192 | + "integrity": "sha1-37eWiqm/+ya9IDda/f/nfVojS3c=", |
| 4193 | "dev": true, | 4193 | "dev": true, |
| 4194 | "requires": { | 4194 | "requires": { |
| 4195 | "camelcase": "^5.3.1", | 4195 | "camelcase": "^5.3.1", | ... | ... |
| ... | @@ -73,6 +73,7 @@ | ... | @@ -73,6 +73,7 @@ |
| 73 | "date-fns": "^2.8.1", | 73 | "date-fns": "^2.8.1", |
| 74 | "electron-updater": "^4.2.0", | 74 | "electron-updater": "^4.2.0", |
| 75 | "element-ui": "^2.13.0", | 75 | "element-ui": "^2.13.0", |
| 76 | + "fs-extra": "^8.1.0", | ||
| 76 | "js-cookie": "^2.2.1", | 77 | "js-cookie": "^2.2.1", |
| 77 | "nedb": "^1.8.0", | 78 | "nedb": "^1.8.0", |
| 78 | "nprogress": "^0.2.0", | 79 | "nprogress": "^0.2.0", |
| ... | @@ -114,7 +115,7 @@ | ... | @@ -114,7 +115,7 @@ |
| 114 | "clean-webpack-plugin": "^3.0.0", | 115 | "clean-webpack-plugin": "^3.0.0", |
| 115 | "copy-webpack-plugin": "^5.1.1", | 116 | "copy-webpack-plugin": "^5.1.1", |
| 116 | "cross-env": "^6.0.3", | 117 | "cross-env": "^6.0.3", |
| 117 | - "css-loader": "^3.4.0", | 118 | + "css-loader": "^3.4.1", |
| 118 | "del": "^5.1.0", | 119 | "del": "^5.1.0", |
| 119 | "electron": "^7.1.7", | 120 | "electron": "^7.1.7", |
| 120 | "electron-builder": "^21.2.0", | 121 | "electron-builder": "^21.2.0", | ... | ... |
| ... | @@ -70,6 +70,7 @@ function createMainWindow () { | ... | @@ -70,6 +70,7 @@ function createMainWindow () { |
| 70 | .catch(err => console.log('Unable to install `vue-devtools`: \n', err)) | 70 | .catch(err => console.log('Unable to install `vue-devtools`: \n', err)) |
| 71 | loadWindow.destroy() | 71 | loadWindow.destroy() |
| 72 | }) | 72 | }) |
| 73 | + mainWindow.webContents.openDevTools(true) | ||
| 73 | } else { | 74 | } else { |
| 74 | mainWindow.webContents.once('dom-ready', () => { | 75 | mainWindow.webContents.once('dom-ready', () => { |
| 75 | mainWindow.show() | 76 | mainWindow.show() |
| ... | @@ -87,7 +88,7 @@ function loadindWindow () { | ... | @@ -87,7 +88,7 @@ function loadindWindow () { |
| 87 | width: 400, | 88 | width: 400, |
| 88 | height: 600, | 89 | height: 600, |
| 89 | frame: false, | 90 | frame: false, |
| 90 | - backgroundColor: '#222428', | 91 | + backgroundColor: '#222', |
| 91 | transparent: true, | 92 | transparent: true, |
| 92 | webPreferences: { experimentalFeatures: true } | 93 | webPreferences: { experimentalFeatures: true } |
| 93 | }) | 94 | }) | ... | ... |
src/renderer/error.js
0 → 100644
| 1 | +import Vue from 'vue' | ||
| 2 | + | ||
| 3 | +Vue.config.errorHandler = function (err, vm, info) { | ||
| 4 | + Vue.nextTick(() => { | ||
| 5 | + if (process.env.NODE_ENV === 'development') { | ||
| 6 | + console.group('%c >>>>>> 错误信息 >>>>>>', 'color:red') | ||
| 7 | + console.log(`%c ${info}`, 'color:blue') | ||
| 8 | + console.groupEnd() | ||
| 9 | + console.group('%c >>>>>> 发生错误的Vue 实例对象 >>>>>>', 'color:green') | ||
| 10 | + console.log(vm) | ||
| 11 | + console.groupEnd() | ||
| 12 | + console.group('%c >>>>>> 发生错误的原因及位置 >>>>>>', 'color:red') | ||
| 13 | + console.error(err) | ||
| 14 | + console.groupEnd() | ||
| 15 | + } | ||
| 16 | + }) | ||
| 17 | +} |
| ... | @@ -9,7 +9,8 @@ import db from './api/operationalData' | ... | @@ -9,7 +9,8 @@ import db from './api/operationalData' |
| 9 | import ElementUI from 'element-ui' | 9 | import ElementUI from 'element-ui' |
| 10 | import 'element-ui/lib/theme-chalk/index.css' | 10 | import 'element-ui/lib/theme-chalk/index.css' |
| 11 | import './permission' | 11 | import './permission' |
| 12 | - | 12 | +// 日志 |
| 13 | +import './error' | ||
| 13 | import './icons' | 14 | import './icons' |
| 14 | import '@/styles/index.scss' | 15 | import '@/styles/index.scss' |
| 15 | 16 | ... | ... |
| ... | @@ -13,7 +13,6 @@ | ... | @@ -13,7 +13,6 @@ |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | html body { | 15 | html body { |
| 16 | - /* on the windows it's con't use l don't why */ | ||
| 17 | background-size: 163px; | 16 | background-size: 163px; |
| 18 | font: 14px/21px Monaco, sans-serif; | 17 | font: 14px/21px Monaco, sans-serif; |
| 19 | color: #999; | 18 | color: #999; |
| ... | @@ -27,89 +26,86 @@ | ... | @@ -27,89 +26,86 @@ |
| 27 | margin: 0px; | 26 | margin: 0px; |
| 28 | } | 27 | } |
| 29 | 28 | ||
| 30 | - html body a, | ||
| 31 | - html body a:visited { | ||
| 32 | - text-decoration: none; | ||
| 33 | - color: #FF805F; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | html body h4 { | 29 | html body h4 { |
| 37 | margin: 0; | 30 | margin: 0; |
| 38 | - color: #666; | ||
| 39 | } | 31 | } |
| 40 | 32 | ||
| 41 | .scene { | 33 | .scene { |
| 42 | - width: 100%; | ||
| 43 | - height: 100%; | ||
| 44 | - -webkit-perspective: 600; | ||
| 45 | - perspective: 600; | ||
| 46 | display: flex; | 34 | display: flex; |
| 47 | - align-items: center; | ||
| 48 | justify-content: center; | 35 | justify-content: center; |
| 36 | + align-items: center; | ||
| 37 | + height: 100%; | ||
| 38 | + background: #222; | ||
| 39 | + position: relative; | ||
| 49 | } | 40 | } |
| 50 | 41 | ||
| 51 | - .scene svg { | 42 | + .loader { |
| 52 | - width: 240px; | 43 | + position: relative; |
| 53 | - height: 240px; | 44 | + width: 15em; |
| 45 | + height: 15em; | ||
| 46 | + background: linear-gradient(-225deg, #ff3cac 0%, #562b7c 52%, #2b86c5 100%); | ||
| 47 | + border-radius: 50%; | ||
| 48 | + animation: spin 0.5s linear infinite; | ||
| 54 | } | 49 | } |
| 55 | 50 | ||
| 56 | - .dc-logo { | 51 | + span { |
| 57 | - position: fixed; | 52 | + position: absolute; |
| 58 | - right: 10px; | 53 | + width: 100%; |
| 59 | - bottom: 10px; | 54 | + height: 100%; |
| 55 | + border-radius: inherit; | ||
| 56 | + background: inherit; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + span:nth-child(1) { | ||
| 60 | + filter: blur(5px); | ||
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | - .dc-logo:hover svg { | 63 | + span:nth-child(2) { |
| 63 | - -webkit-transform-origin: 50% 50%; | 64 | + filter: blur(10px); |
| 64 | - transform-origin: 50% 50%; | ||
| 65 | - -webkit-animation: arrow-spin 2.5s 0s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; | ||
| 66 | - animation: arrow-spin 2.5s 0s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; | ||
| 67 | } | 65 | } |
| 68 | 66 | ||
| 69 | - .dc-logo:hover:hover:before { | 67 | + span:nth-child(3) { |
| 70 | - content: '\2764'; | 68 | + filter: blur(25px); |
| 71 | - padding: 6px; | 69 | + } |
| 72 | - font: 10px/1 Monaco, sans-serif; | 70 | + |
| 73 | - font-size: 10px; | 71 | + span:nth-child(4) { |
| 74 | - color: #00fffe; | 72 | + filter: blur(50px); |
| 75 | - text-transform: uppercase; | 73 | + } |
| 74 | + | ||
| 75 | + span::after { | ||
| 76 | position: absolute; | 76 | position: absolute; |
| 77 | - left: -70px; | 77 | + content: ""; |
| 78 | - top: -30px; | 78 | + top: 10px; |
| 79 | - white-space: nowrap; | 79 | + left: 10px; |
| 80 | - z-index: 20px; | 80 | + right: 10px; |
| 81 | - box-shadow: 0px 0px 4px #222; | 81 | + bottom: 10px; |
| 82 | - background: rgba(0, 0, 0, 0.4); | 82 | + background: #222; |
| 83 | - } | 83 | + border-radius: inherit; |
| 84 | - | 84 | + } |
| 85 | - .dc-logo:hover:hover:after { | 85 | + |
| 86 | - content: 'Digital Craft'; | 86 | + .text { |
| 87 | - padding: 6px; | ||
| 88 | - font: 10px/1 Monaco, sans-serif; | ||
| 89 | - font-size: 10px; | ||
| 90 | - color: #6E6F71; | ||
| 91 | - text-transform: uppercase; | ||
| 92 | position: absolute; | 87 | position: absolute; |
| 93 | - right: 0; | 88 | + opacity: 0; |
| 94 | - top: -30px; | 89 | + animation: breath 3s ease-in-out infinite; |
| 95 | - white-space: nowrap; | 90 | + } |
| 96 | - z-index: 20px; | 91 | + |
| 97 | - box-shadow: 0px 0px 4px #222; | 92 | + @keyframes breath { |
| 98 | - background: rgba(0, 0, 0, 0.4); | 93 | + from { |
| 99 | - background-image: none; | 94 | + opacity: 0.05; |
| 100 | } | 95 | } |
| 101 | 96 | ||
| 102 | - @-webkit-keyframes arrow-spin { | ||
| 103 | 50% { | 97 | 50% { |
| 104 | - -webkit-transform: rotateY(360deg); | 98 | + opacity: 1; |
| 105 | - transform: rotateY(360deg); | 99 | + } |
| 100 | + | ||
| 101 | + to { | ||
| 102 | + opacity: 0.05; | ||
| 106 | } | 103 | } |
| 107 | } | 104 | } |
| 108 | 105 | ||
| 109 | - @keyframes arrow-spin { | 106 | + @keyframes spin { |
| 110 | - 50% { | 107 | + to { |
| 111 | - -webkit-transform: rotateY(360deg); | 108 | + transform: rotate(1turn); |
| 112 | - transform: rotateY(360deg); | ||
| 113 | } | 109 | } |
| 114 | } | 110 | } |
| 115 | </style> | 111 | </style> |
| ... | @@ -117,35 +113,13 @@ | ... | @@ -117,35 +113,13 @@ |
| 117 | 113 | ||
| 118 | <body> | 114 | <body> |
| 119 | <div class="scene"> | 115 | <div class="scene"> |
| 120 | - <svg version="1.1" id="dc-spinner" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width:"38" height:"38" | 116 | + <div class="loader"> |
| 121 | - viewBox="0 0 38 38" preserveAspectRatio="xMinYMin meet"> | 117 | + <span></span> |
| 122 | - <text x="13" y="21" font-family="Monaco" font-size="2px" style="letter-spacing:0.6" fill="grey">准备资源中... | 118 | + <span></span> |
| 123 | - <animate attributeName="opacity" values="0;1;0" dur="1.8s" repeatCount="indefinite" /> | 119 | + <span></span> |
| 124 | - </text> | 120 | + <span></span> |
| 125 | - <path fill="#373a42" d="M20,35c-8.271,0-15-6.729-15-15S11.729,5,20,5s15,6.729,15,15S28.271,35,20,35z M20,5.203 | 121 | + </div> |
| 126 | - C11.841,5.203,5.203,11.841,5.203,20c0,8.159,6.638,14.797,14.797,14.797S34.797,28.159,34.797,20 | 122 | + <div class="text">正在准备资源中...</div> |
| 127 | - C34.797,11.841,28.159,5.203,20,5.203z"> | ||
| 128 | - </path> | ||
| 129 | - | ||
| 130 | - <path fill="#373a42" d="M20,33.125c-7.237,0-13.125-5.888-13.125-13.125S12.763,6.875,20,6.875S33.125,12.763,33.125,20 | ||
| 131 | - S27.237,33.125,20,33.125z M20,7.078C12.875,7.078,7.078,12.875,7.078,20c0,7.125,5.797,12.922,12.922,12.922 | ||
| 132 | - S32.922,27.125,32.922,20C32.922,12.875,27.125,7.078,20,7.078z"> | ||
| 133 | - </path> | ||
| 134 | - | ||
| 135 | - <path fill="#2AA198" stroke="#2AA198" stroke-width="0.6027" stroke-miterlimit="10" | ||
| 136 | - d="M5.203,20 | ||
| 137 | - c0-8.159,6.638-14.797,14.797-14.797V5C11.729,5,5,11.729,5,20s6.729,15,15,15v-0.203C11.841,34.797,5.203,28.159,5.203,20z"> | ||
| 138 | - <animateTransform attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" calcMode="spline" | ||
| 139 | - keySplines="0.4, 0, 0.2, 1" keyTimes="0;1" dur="2s" repeatCount="indefinite" /> | ||
| 140 | - </path> | ||
| 141 | - | ||
| 142 | - <path fill="#859900" stroke="#859900" stroke-width="0.2027" stroke-miterlimit="10" d="M7.078,20 | ||
| 143 | - c0-7.125,5.797-12.922,12.922-12.922V6.875C12.763,6.875,6.875,12.763,6.875,20S12.763,33.125,20,33.125v-0.203 | ||
| 144 | - C12.875,32.922,7.078,27.125,7.078,20z"> | ||
| 145 | - <animateTransform attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" dur="1.8s" | ||
| 146 | - repeatCount="indefinite" /> | ||
| 147 | - </path> | ||
| 148 | - </svg> | ||
| 149 | </div> | 123 | </div> |
| 150 | 124 | ||
| 151 | </body> | 125 | </body> | ... | ... |
-
请 注册 或 登录 后发表评论