@etsoo/appscript 1.4.29 → 1.4.31

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.
@@ -526,8 +526,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
526
526
  /**
527
527
  * Go to the login page
528
528
  * @param tryLogin Try to login again
529
+ * @param removeUrl Remove current URL for reuse
529
530
  */
530
- toLoginPage(tryLogin?: boolean): void;
531
+ toLoginPage(tryLogin?: boolean, removeUrl?: boolean): void;
531
532
  /**
532
533
  * Try login, returning false means is loading
533
534
  * UI get involved while refreshToken not intended
@@ -1292,16 +1292,16 @@ class CoreApp {
1292
1292
  // Clear
1293
1293
  this.userLogout();
1294
1294
  // Go to login page
1295
- this.toLoginPage();
1295
+ this.toLoginPage(false, true);
1296
1296
  }
1297
1297
  /**
1298
1298
  * Go to the login page
1299
1299
  * @param tryLogin Try to login again
1300
+ * @param removeUrl Remove current URL for reuse
1300
1301
  */
1301
- toLoginPage(tryLogin) {
1302
- const url = '/?url=' +
1303
- encodeURIComponent(location.href) +
1304
- (tryLogin ? '' : '&tryLogin=false');
1302
+ toLoginPage(tryLogin, removeUrl) {
1303
+ const url = `/?tryLogin=${tryLogin !== null && tryLogin !== void 0 ? tryLogin : false}` +
1304
+ (removeUrl ? '' : '&url=' + encodeURIComponent(location.href));
1305
1305
  this.navigate(url);
1306
1306
  }
1307
1307
  /**
@@ -459,8 +459,9 @@ export interface IApp {
459
459
  /**
460
460
  * Go to the login page
461
461
  * @param tryLogin Try to login again
462
+ * @param removeUrl Remove current URL for reuse
462
463
  */
463
- toLoginPage(tryLogin?: boolean): void;
464
+ toLoginPage(tryLogin?: boolean, removeUrl?: boolean): void;
464
465
  /**
465
466
  * Try login, returning false means is loading
466
467
  * UI get involved while refreshToken not intended
@@ -11,6 +11,7 @@
11
11
  "back": "Back",
12
12
  "cancel": "Cancel",
13
13
  "changePassword": "Change password",
14
+ "changeReload": "{0} has just changed data, do you want to reload? Reloading will cause the current modification to be lost!",
14
15
  "clickForDetails": "Click for details",
15
16
  "city": "City",
16
17
  "clear": "Clear",
@@ -11,6 +11,7 @@
11
11
  "back": "后退",
12
12
  "cancel": "取消",
13
13
  "changePassword": "修改密码",
14
+ "changeReload": "{0} 刚更改了数据,是否重新加载?重新加载将导致当前的修改丢失!",
14
15
  "clickForDetails": "点击查看详情",
15
16
  "city": "城市",
16
17
  "clear": "清除",
@@ -11,6 +11,7 @@
11
11
  "back": "後退",
12
12
  "cancel": "取消",
13
13
  "changePassword": "修改密碼",
14
+ "changeReload": "{0} 剛更改了數據,是否重新加載?重新加載將導致當前的修改丟失!",
14
15
  "clickForDetails": "點擊查看詳情",
15
16
  "city": "城市",
16
17
  "clear": "清除",
@@ -9,26 +9,32 @@ export interface IUserData {
9
9
  readonly deviceId: string;
10
10
  /**
11
11
  * User name
12
+ * 用户姓名
12
13
  */
13
14
  readonly name: string;
14
15
  /**
15
16
  * User avatar
17
+ * 用户头像
16
18
  */
17
19
  readonly avatar?: string;
18
20
  /**
19
21
  * Organization id
22
+ * 机构编号
20
23
  */
21
24
  readonly organization?: number;
22
25
  /**
23
26
  * User role value
27
+ * 用户角色值
24
28
  */
25
29
  readonly role: number;
26
30
  /**
27
31
  * Refresh seconds
32
+ * 刷新间隔秒数
28
33
  */
29
34
  readonly seconds: number;
30
35
  /**
31
36
  * Access token
37
+ * 访问令牌
32
38
  */
33
39
  readonly token: string;
34
40
  }
@@ -526,8 +526,9 @@ export declare abstract class CoreApp<U extends IUser, S extends IAppSettings, N
526
526
  /**
527
527
  * Go to the login page
528
528
  * @param tryLogin Try to login again
529
+ * @param removeUrl Remove current URL for reuse
529
530
  */
530
- toLoginPage(tryLogin?: boolean): void;
531
+ toLoginPage(tryLogin?: boolean, removeUrl?: boolean): void;
531
532
  /**
532
533
  * Try login, returning false means is loading
533
534
  * UI get involved while refreshToken not intended
@@ -1266,16 +1266,16 @@ export class CoreApp {
1266
1266
  // Clear
1267
1267
  this.userLogout();
1268
1268
  // Go to login page
1269
- this.toLoginPage();
1269
+ this.toLoginPage(false, true);
1270
1270
  }
1271
1271
  /**
1272
1272
  * Go to the login page
1273
1273
  * @param tryLogin Try to login again
1274
+ * @param removeUrl Remove current URL for reuse
1274
1275
  */
1275
- toLoginPage(tryLogin) {
1276
- const url = '/?url=' +
1277
- encodeURIComponent(location.href) +
1278
- (tryLogin ? '' : '&tryLogin=false');
1276
+ toLoginPage(tryLogin, removeUrl) {
1277
+ const url = `/?tryLogin=${tryLogin !== null && tryLogin !== void 0 ? tryLogin : false}` +
1278
+ (removeUrl ? '' : '&url=' + encodeURIComponent(location.href));
1279
1279
  this.navigate(url);
1280
1280
  }
1281
1281
  /**
@@ -459,8 +459,9 @@ export interface IApp {
459
459
  /**
460
460
  * Go to the login page
461
461
  * @param tryLogin Try to login again
462
+ * @param removeUrl Remove current URL for reuse
462
463
  */
463
- toLoginPage(tryLogin?: boolean): void;
464
+ toLoginPage(tryLogin?: boolean, removeUrl?: boolean): void;
464
465
  /**
465
466
  * Try login, returning false means is loading
466
467
  * UI get involved while refreshToken not intended
@@ -11,6 +11,7 @@
11
11
  "back": "Back",
12
12
  "cancel": "Cancel",
13
13
  "changePassword": "Change password",
14
+ "changeReload": "{0} has just changed data, do you want to reload? Reloading will cause the current modification to be lost!",
14
15
  "clickForDetails": "Click for details",
15
16
  "city": "City",
16
17
  "clear": "Clear",
@@ -11,6 +11,7 @@
11
11
  "back": "后退",
12
12
  "cancel": "取消",
13
13
  "changePassword": "修改密码",
14
+ "changeReload": "{0} 刚更改了数据,是否重新加载?重新加载将导致当前的修改丢失!",
14
15
  "clickForDetails": "点击查看详情",
15
16
  "city": "城市",
16
17
  "clear": "清除",
@@ -11,6 +11,7 @@
11
11
  "back": "後退",
12
12
  "cancel": "取消",
13
13
  "changePassword": "修改密碼",
14
+ "changeReload": "{0} 剛更改了數據,是否重新加載?重新加載將導致當前的修改丟失!",
14
15
  "clickForDetails": "點擊查看詳情",
15
16
  "city": "城市",
16
17
  "clear": "清除",
@@ -9,26 +9,32 @@ export interface IUserData {
9
9
  readonly deviceId: string;
10
10
  /**
11
11
  * User name
12
+ * 用户姓名
12
13
  */
13
14
  readonly name: string;
14
15
  /**
15
16
  * User avatar
17
+ * 用户头像
16
18
  */
17
19
  readonly avatar?: string;
18
20
  /**
19
21
  * Organization id
22
+ * 机构编号
20
23
  */
21
24
  readonly organization?: number;
22
25
  /**
23
26
  * User role value
27
+ * 用户角色值
24
28
  */
25
29
  readonly role: number;
26
30
  /**
27
31
  * Refresh seconds
32
+ * 刷新间隔秒数
28
33
  */
29
34
  readonly seconds: number;
30
35
  /**
31
36
  * Access token
37
+ * 访问令牌
32
38
  */
33
39
  readonly token: string;
34
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.29",
3
+ "version": "1.4.31",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "homepage": "https://github.com/ETSOO/AppScript#readme",
54
54
  "dependencies": {
55
- "@etsoo/notificationbase": "^1.1.25",
55
+ "@etsoo/notificationbase": "^1.1.26",
56
56
  "@etsoo/restclient": "^1.0.89",
57
57
  "@etsoo/shared": "^1.2.8",
58
58
  "crypto-js": "^4.1.1"
@@ -1659,18 +1659,19 @@ export abstract class CoreApp<
1659
1659
  this.userLogout();
1660
1660
 
1661
1661
  // Go to login page
1662
- this.toLoginPage();
1662
+ this.toLoginPage(false, true);
1663
1663
  }
1664
1664
 
1665
1665
  /**
1666
1666
  * Go to the login page
1667
1667
  * @param tryLogin Try to login again
1668
+ * @param removeUrl Remove current URL for reuse
1668
1669
  */
1669
- toLoginPage(tryLogin?: boolean) {
1670
+ toLoginPage(tryLogin?: boolean, removeUrl?: boolean) {
1670
1671
  const url =
1671
- '/?url=' +
1672
- encodeURIComponent(location.href) +
1673
- (tryLogin ? '' : '&tryLogin=false');
1672
+ `/?tryLogin=${tryLogin ?? false}` +
1673
+ (removeUrl ? '' : '&url=' + encodeURIComponent(location.href));
1674
+
1674
1675
  this.navigate(url);
1675
1676
  }
1676
1677
 
package/src/app/IApp.ts CHANGED
@@ -619,8 +619,9 @@ export interface IApp {
619
619
  /**
620
620
  * Go to the login page
621
621
  * @param tryLogin Try to login again
622
+ * @param removeUrl Remove current URL for reuse
622
623
  */
623
- toLoginPage(tryLogin?: boolean): void;
624
+ toLoginPage(tryLogin?: boolean, removeUrl?: boolean): void;
624
625
 
625
626
  /**
626
627
  * Try login, returning false means is loading
package/src/i18n/en.json CHANGED
@@ -11,6 +11,7 @@
11
11
  "back": "Back",
12
12
  "cancel": "Cancel",
13
13
  "changePassword": "Change password",
14
+ "changeReload": "{0} has just changed data, do you want to reload? Reloading will cause the current modification to be lost!",
14
15
  "clickForDetails": "Click for details",
15
16
  "city": "City",
16
17
  "clear": "Clear",
@@ -11,6 +11,7 @@
11
11
  "back": "后退",
12
12
  "cancel": "取消",
13
13
  "changePassword": "修改密码",
14
+ "changeReload": "{0} 刚更改了数据,是否重新加载?重新加载将导致当前的修改丢失!",
14
15
  "clickForDetails": "点击查看详情",
15
16
  "city": "城市",
16
17
  "clear": "清除",
@@ -11,6 +11,7 @@
11
11
  "back": "後退",
12
12
  "cancel": "取消",
13
13
  "changePassword": "修改密碼",
14
+ "changeReload": "{0} 剛更改了數據,是否重新加載?重新加載將導致當前的修改丟失!",
14
15
  "clickForDetails": "點擊查看詳情",
15
16
  "city": "城市",
16
17
  "clear": "清除",
package/src/state/User.ts CHANGED
@@ -11,31 +11,37 @@ export interface IUserData {
11
11
 
12
12
  /**
13
13
  * User name
14
+ * 用户姓名
14
15
  */
15
16
  readonly name: string;
16
17
 
17
18
  /**
18
19
  * User avatar
20
+ * 用户头像
19
21
  */
20
22
  readonly avatar?: string;
21
23
 
22
24
  /**
23
25
  * Organization id
26
+ * 机构编号
24
27
  */
25
28
  readonly organization?: number;
26
29
 
27
30
  /**
28
31
  * User role value
32
+ * 用户角色值
29
33
  */
30
34
  readonly role: number;
31
35
 
32
36
  /**
33
37
  * Refresh seconds
38
+ * 刷新间隔秒数
34
39
  */
35
40
  readonly seconds: number;
36
41
 
37
42
  /**
38
43
  * Access token
44
+ * 访问令牌
39
45
  */
40
46
  readonly token: string;
41
47
  }