@hlw-uni/mp-vue 2.0.2 → 2.0.4

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/dist/app.d.ts CHANGED
@@ -10,7 +10,7 @@ export interface InterceptorOptions {
10
10
  /** Token 来源函数 */
11
11
  getToken?: () => string;
12
12
  /** 登录失效时的处理函数 */
13
- onUnauthorized?: () => void;
13
+ onLogout?: () => void;
14
14
  /** 接口业务错误码是否自动 toast */
15
15
  autoToastError?: boolean;
16
16
  }
package/dist/index.js CHANGED
@@ -1846,7 +1846,7 @@ var __publicField = (obj, key, value) => {
1846
1846
  const offError = http.onError((err) => {
1847
1847
  var _a;
1848
1848
  if (err.message.includes("401")) {
1849
- (_a = opts.onUnauthorized) == null ? void 0 : _a.call(opts);
1849
+ (_a = opts.onLogout) == null ? void 0 : _a.call(opts);
1850
1850
  }
1851
1851
  });
1852
1852
  _interceptorCleanup = [offRequest, offResponse, offError];
package/dist/index.mjs CHANGED
@@ -1845,7 +1845,7 @@ function setupInterceptors(options = {}) {
1845
1845
  const offError = http.onError((err) => {
1846
1846
  var _a;
1847
1847
  if (err.message.includes("401")) {
1848
- (_a = opts.onUnauthorized) == null ? void 0 : _a.call(opts);
1848
+ (_a = opts.onLogout) == null ? void 0 : _a.call(opts);
1849
1849
  }
1850
1850
  });
1851
1851
  _interceptorCleanup = [offRequest, offResponse, offError];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hlw-uni/mp-vue",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "hlw-uni 小程序运行时 — Vue 组件 + composables + theme + http + 工具集(合并自原 mp-core)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/src/app.ts CHANGED
@@ -20,7 +20,7 @@ export interface InterceptorOptions {
20
20
  /** Token 来源函数 */
21
21
  getToken?: () => string;
22
22
  /** 登录失效时的处理函数 */
23
- onUnauthorized?: () => void;
23
+ onLogout?: () => void;
24
24
  /** 接口业务错误码是否自动 toast */
25
25
  autoToastError?: boolean;
26
26
  }
@@ -165,7 +165,7 @@ export function setupInterceptors(options: InterceptorOptions & { sigSecret?: st
165
165
  */
166
166
  const offError = http.onError((err: Error) => {
167
167
  if (err.message.includes('401')) {
168
- opts.onUnauthorized?.();
168
+ opts.onLogout?.();
169
169
  }
170
170
  });
171
171