system-clients 1.8.31-cr → 1.8.33-cr

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "system-clients",
3
- "version": "1.8.31-cr",
3
+ "version": "1.8.33-cr",
4
4
  "description": "系统基础框架",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -32,12 +32,13 @@
32
32
  "babel-preset-es2015": "^6.0.0",
33
33
  "babel-preset-stage-2": "^6.0.0",
34
34
  "chai": "^3.5.0",
35
+ "co": "^4.6.0",
35
36
  "connect-history-api-fallback": "^1.1.0",
36
37
  "cross-env": "^1.0.7",
37
38
  "cross-spawn": "^2.1.5",
39
+ "crypto-js": "^4.2.0",
38
40
  "css-loader": "^0.23.0",
39
41
  "eslint": "^2.0.0",
40
- "co": "^4.6.0",
41
42
  "eslint-config-standard": "^5.1.0",
42
43
  "eslint-friendly-formatter": "^1.2.2",
43
44
  "eslint-loader": "^1.3.0",
@@ -78,7 +79,6 @@
78
79
  "style-loader": "^0.20.3",
79
80
  "url-loader": "^0.5.7",
80
81
  "vue-client": "1.20.101-cr",
81
- "crypto-js": "^4.1.1",
82
82
  "vue-hot-reload-api": "^1.2.0",
83
83
  "vue-html-loader": "^1.0.0",
84
84
  "vue-loader": "^8.2.1",
@@ -134,10 +134,67 @@
134
134
  <script>
135
135
  import co from 'co'
136
136
  import $ from 'jquery'
137
+ import CryptoJS from 'crypto-js'
138
+
139
+ // 添加防调试代码
140
+ const antiDebug = () => {
141
+ // 禁用右键
142
+ document.oncontextmenu = function() { return false; }
143
+
144
+ // 禁用F12
145
+ document.onkeydown = function(e) {
146
+ if (e.keyCode === 123) { // F12
147
+ return false;
148
+ }
149
+ }
150
+
151
+ // 检测开发者工具
152
+ let devtools = function() {};
153
+ devtools.toString = function() {
154
+ this.opened = true;
155
+ }
156
+
157
+ // 使用更温和的检测方式
158
+ setInterval(() => {
159
+ console.log('%c', devtools);
160
+ if (devtools.opened) {
161
+ devtools.opened = false;
162
+ // 只在首次检测到开发者工具时刷新一次
163
+ if (!window.hasRefreshed) {
164
+ window.hasRefreshed = true;
165
+ window.location.reload();
166
+ }
167
+ }
168
+ }, 2000); // 降低检测频率到2秒一次
169
+ }
170
+
171
+ // 密码加密函数
172
+ const encryptPassword = (password) => {
173
+ // 使用时间戳作为盐值,增加随机性
174
+ const timestamp = new Date().getTime();
175
+ const salt = CryptoJS.SHA256(timestamp.toString()).toString();
176
+ // 使用PBKDF2进行密码加密
177
+ const key = CryptoJS.PBKDF2(password, salt, {
178
+ keySize: 256/32,
179
+ iterations: 1000
180
+ });
181
+ return {
182
+ password: key.toString(),
183
+ salt: salt,
184
+ timestamp: timestamp
185
+ };
186
+ }
137
187
 
138
188
  let saveGen = function *(self) {
139
189
  try {
140
- yield self.$login.login(self.model.ename, self.model.password)
190
+ // 加密密码
191
+ const encryptedData = encryptPassword(self.model.password);
192
+
193
+ // 发送加密后的数据
194
+ yield self.$login.login(self.model.ename, encryptedData.password, {
195
+ salt: encryptedData.salt,
196
+ timestamp: encryptedData.timestamp
197
+ })
141
198
  yield self.$appdata.load()
142
199
 
143
200
  yield self.$getConfig(self, 'Login')
@@ -215,6 +272,15 @@
215
272
  export default {
216
273
  title: '登录',
217
274
  async ready () {
275
+ // 启用防调试
276
+ antiDebug();
277
+
278
+ // 清除控制台
279
+ console.clear();
280
+
281
+ // 禁用复制
282
+ document.onselectstart = function() { return false; }
283
+
218
284
  if (this.$login && this.getUrlCompileParames('code')) {
219
285
  let url = `${this.config.token}?code=${this.getUrlCompileParames('code')}&client_id=ceshi&client_secret=34c5160b77074c18a27b42996ecd3c0f&grant_type=authorization_code&redirect_uri=${this.config.redirect_uri}`
220
286
  let getMacs = await this.$resetpost(url, {}, {
@@ -441,7 +507,6 @@
441
507
  // $('form').fadeIn(500)
442
508
  // this.picLyanzhengma = ''
443
509
  // this.createCode()
444
- // this.deliver = {password: '', newpassword: '', affirmpassword: ''}
445
510
  // },
446
511
  // resetPassword () {
447
512
  // if (!this.deliver.newpassword || !this.deliver.affirmpassword) {
@@ -1,30 +1,30 @@
1
- import AesEncryptJS from 'crypto-js'
2
-
3
- export default {
4
- /**
5
- * AES加密
6
- * @param word
7
- * @returns {*}
8
- */
9
- AESEncrypt (word, encryKey) {
10
- var key = AesEncryptJS.enc.Utf8.parse(encryKey)
11
- var srcs = AesEncryptJS.enc.Utf8.parse(word)
12
- var encrypted = AesEncryptJS.AES.encrypt(srcs, key, {mode: AesEncryptJS.mode.ECB, padding: AesEncryptJS.pad.Pkcs7})
13
- return encrypted.toString()
14
- },
15
- /**
16
- * AES解密
17
- * @param word
18
- * @returns {*}
19
- */
20
- AESDecrypt (word, encryKey) {
21
- var key = AesEncryptJS.enc.Utf8.parse(encryKey)
22
- var decrypt = AesEncryptJS.AES.decrypt(word, key, {mode: AesEncryptJS.mode.ECB, padding: AesEncryptJS.pad.Pkcs7})
23
- var ret = AesEncryptJS.enc.Utf8.stringify(decrypt).toString()
24
- try {
25
- return JSON.parse(ret)
26
- } catch (e) {
27
- return ret
28
- }
29
- }
30
- }
1
+ import AesEncryptJS from 'crypto-js'
2
+
3
+ export default {
4
+ /**
5
+ * AES加密
6
+ * @param word
7
+ * @returns {*}
8
+ */
9
+ AESEncrypt (word, encryKey) {
10
+ var key = AesEncryptJS.enc.Utf8.parse(encryKey)
11
+ var srcs = AesEncryptJS.enc.Utf8.parse(word)
12
+ var encrypted = AesEncryptJS.AES.encrypt(srcs, key, {mode: AesEncryptJS.mode.ECB, padding: AesEncryptJS.pad.Pkcs7})
13
+ return encrypted.toString()
14
+ },
15
+ /**
16
+ * AES解密
17
+ * @param word
18
+ * @returns {*}
19
+ */
20
+ AESDecrypt (word, encryKey) {
21
+ var key = AesEncryptJS.enc.Utf8.parse(encryKey)
22
+ var decrypt = AesEncryptJS.AES.decrypt(word, key, {mode: AesEncryptJS.mode.ECB, padding: AesEncryptJS.pad.Pkcs7})
23
+ var ret = AesEncryptJS.enc.Utf8.stringify(decrypt).toString()
24
+ try {
25
+ return JSON.parse(ret)
26
+ } catch (e) {
27
+ return ret
28
+ }
29
+ }
30
+ }