@etsoo/materialui 1.3.92 → 1.3.93

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.
@@ -19,6 +19,11 @@ export interface IServiceUser extends IUser {
19
19
  * 服务(应用)加密密钥
20
20
  */
21
21
  readonly passphrase?: string;
22
+ /**
23
+ * Device id
24
+ * 设备编号
25
+ */
26
+ readonly deviceId?: string;
22
27
  }
23
28
  /**
24
29
  * Service user login result
@@ -72,11 +72,13 @@ export class ServiceApp extends ReactApp {
72
72
  userLogin(user, refreshToken, keep, dispatch) {
73
73
  // Super call, set token
74
74
  super.userLogin(user, refreshToken, keep, dispatch);
75
- if (user.passphrase) {
75
+ if (user.deviceId && user.passphrase) {
76
76
  // Save the passphrase
77
77
  const passphrase = this.decrypt(user.passphrase, `${user.uid}-${this.settings.appId}`);
78
- if (passphrase)
78
+ if (passphrase) {
79
+ this.deviceId = user.deviceId;
79
80
  this.updatePassphrase(passphrase);
81
+ }
80
82
  }
81
83
  }
82
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.3.92",
3
+ "version": "1.3.93",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "@emotion/css": "^11.13.4",
51
51
  "@emotion/react": "^11.13.3",
52
52
  "@emotion/styled": "^11.13.0",
53
- "@etsoo/appscript": "^1.5.25",
53
+ "@etsoo/appscript": "^1.5.26",
54
54
  "@etsoo/notificationbase": "^1.1.48",
55
55
  "@etsoo/react": "^1.7.68",
56
56
  "@etsoo/shared": "^1.2.46",
@@ -87,10 +87,10 @@
87
87
  "@types/react-dom": "^18.3.0",
88
88
  "@types/react-input-mask": "^3.0.5",
89
89
  "@types/react-window": "^1.8.8",
90
- "@typescript-eslint/eslint-plugin": "^8.8.0",
91
- "@typescript-eslint/parser": "^8.8.0",
90
+ "@typescript-eslint/eslint-plugin": "^8.8.1",
91
+ "@typescript-eslint/parser": "^8.8.1",
92
92
  "jest": "^29.7.0",
93
93
  "jest-environment-jsdom": "^29.7.0",
94
- "typescript": "^5.6.2"
94
+ "typescript": "^5.6.3"
95
95
  }
96
96
  }
@@ -22,6 +22,12 @@ export interface IServiceUser extends IUser {
22
22
  * 服务(应用)加密密钥
23
23
  */
24
24
  readonly passphrase?: string;
25
+
26
+ /**
27
+ * Device id
28
+ * 设备编号
29
+ */
30
+ readonly deviceId?: string;
25
31
  }
26
32
 
27
33
  /**
@@ -107,13 +107,16 @@ export class ServiceApp<
107
107
  // Super call, set token
108
108
  super.userLogin(user, refreshToken, keep, dispatch);
109
109
 
110
- if (user.passphrase) {
110
+ if (user.deviceId && user.passphrase) {
111
111
  // Save the passphrase
112
112
  const passphrase = this.decrypt(
113
113
  user.passphrase,
114
114
  `${user.uid}-${this.settings.appId}`
115
115
  );
116
- if (passphrase) this.updatePassphrase(passphrase);
116
+ if (passphrase) {
117
+ this.deviceId = user.deviceId;
118
+ this.updatePassphrase(passphrase);
119
+ }
117
120
  }
118
121
  }
119
122
  }