@etsoo/materialui 1.4.56 → 1.4.57
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/lib/app/ServiceApp.d.ts +0 -7
- package/lib/app/ServiceApp.js +6 -15
- package/package.json +1 -1
- package/src/app/ServiceApp.ts +10 -20
package/lib/app/ServiceApp.d.ts
CHANGED
|
@@ -47,13 +47,6 @@ export declare class ServiceApp<U extends IServiceUser = IServiceUser, P extends
|
|
|
47
47
|
* @param action Callback
|
|
48
48
|
*/
|
|
49
49
|
signout(action?: () => void | boolean): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* User login extended
|
|
52
|
-
* @param user New user
|
|
53
|
-
* @param refreshToken Refresh token
|
|
54
|
-
* @param dispatch User state dispatch
|
|
55
|
-
*/
|
|
56
|
-
userLogin(user: U, refreshToken: string, dispatch?: boolean): void;
|
|
57
50
|
/**
|
|
58
51
|
*
|
|
59
52
|
* @param user Current user
|
package/lib/app/ServiceApp.js
CHANGED
|
@@ -106,12 +106,13 @@ export class ServiceApp extends ReactApp {
|
|
|
106
106
|
return super.signout(action);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
110
|
-
* @param user
|
|
111
|
-
* @param
|
|
109
|
+
*
|
|
110
|
+
* @param user Current user
|
|
111
|
+
* @param core Core system API token data
|
|
112
|
+
* @param keep Keep in local storage or not
|
|
112
113
|
* @param dispatch User state dispatch
|
|
113
114
|
*/
|
|
114
|
-
|
|
115
|
+
userLoginEx(user, core, dispatch) {
|
|
115
116
|
if (user.clientDeviceId && user.passphrase) {
|
|
116
117
|
// Save the passphrase
|
|
117
118
|
// Interpolated string expressions are different between TypeScript and C# for the null value
|
|
@@ -121,20 +122,10 @@ export class ServiceApp extends ReactApp {
|
|
|
121
122
|
this.updatePassphrase(passphrase);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
|
-
// Super call, set token
|
|
125
|
-
super.userLogin(user, refreshToken, dispatch);
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* @param user Current user
|
|
130
|
-
* @param core Core system API token data
|
|
131
|
-
* @param keep Keep in local storage or not
|
|
132
|
-
* @param dispatch User state dispatch
|
|
133
|
-
*/
|
|
134
|
-
userLoginEx(user, core, dispatch) {
|
|
135
125
|
// User login
|
|
136
126
|
const { refreshToken } = user;
|
|
137
127
|
// Core system login
|
|
128
|
+
// It's the extreme case, the core system token should not be the same with the current app user token
|
|
138
129
|
core ??= {
|
|
139
130
|
refreshToken,
|
|
140
131
|
accessToken: user.token,
|
package/package.json
CHANGED
package/src/app/ServiceApp.ts
CHANGED
|
@@ -139,12 +139,17 @@ export class ServiceApp<
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
*
|
|
143
|
-
* @param user
|
|
144
|
-
* @param
|
|
142
|
+
*
|
|
143
|
+
* @param user Current user
|
|
144
|
+
* @param core Core system API token data
|
|
145
|
+
* @param keep Keep in local storage or not
|
|
145
146
|
* @param dispatch User state dispatch
|
|
146
147
|
*/
|
|
147
|
-
|
|
148
|
+
userLoginEx(
|
|
149
|
+
user: U & ServiceUserToken,
|
|
150
|
+
core?: ApiRefreshTokenDto,
|
|
151
|
+
dispatch?: boolean
|
|
152
|
+
) {
|
|
148
153
|
if (user.clientDeviceId && user.passphrase) {
|
|
149
154
|
// Save the passphrase
|
|
150
155
|
// Interpolated string expressions are different between TypeScript and C# for the null value
|
|
@@ -158,26 +163,11 @@ export class ServiceApp<
|
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
165
|
|
|
161
|
-
// Super call, set token
|
|
162
|
-
super.userLogin(user, refreshToken, dispatch);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
*
|
|
167
|
-
* @param user Current user
|
|
168
|
-
* @param core Core system API token data
|
|
169
|
-
* @param keep Keep in local storage or not
|
|
170
|
-
* @param dispatch User state dispatch
|
|
171
|
-
*/
|
|
172
|
-
userLoginEx(
|
|
173
|
-
user: U & ServiceUserToken,
|
|
174
|
-
core?: ApiRefreshTokenDto,
|
|
175
|
-
dispatch?: boolean
|
|
176
|
-
) {
|
|
177
166
|
// User login
|
|
178
167
|
const { refreshToken } = user;
|
|
179
168
|
|
|
180
169
|
// Core system login
|
|
170
|
+
// It's the extreme case, the core system token should not be the same with the current app user token
|
|
181
171
|
core ??= {
|
|
182
172
|
refreshToken,
|
|
183
173
|
accessToken: user.token,
|