wui-components-v2 1.2.53 → 1.2.54

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.
Files changed (2) hide show
  1. package/api/login.ts +4 -5
  2. package/package.json +1 -1
package/api/login.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  // 导入核心alova实例
2
2
  import dayjs from 'dayjs/esm/index'
3
- import timezone from 'dayjs/esm/plugin/timezone'
4
- import utc from 'dayjs/esm/plugin/utc'
5
3
  import rsaEncrypt from '../utils/rsaEncrypt'
6
4
  import req from './core/index'
7
5
  // 获取公钥
@@ -18,9 +16,10 @@ export async function login(
18
16
  kaptchaToken: string = '',
19
17
  kaptchaText: string = ''
20
18
  ): Promise<any> {
21
- dayjs.extend(utc)
22
- dayjs.extend(timezone)
23
- const datetime = dayjs(new Date()).tz('Europe/London').format('YYYY-MM-DD HH:mm:ss')
19
+ // 注意:不能依赖 dayjs timezone/utc 插件,它们在 App 端会使用 Intl.DateTimeFormat,
20
+ // 而部分 App 环境(如 Android webview)未提供全局 Intl,会抛 ReferenceError: Intl is not defined。
21
+ // 这里用基础格式化取本地时间即可(不依赖 Intl)。
22
+ const datetime = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')
24
23
  const json = {
25
24
  username,
26
25
  password,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.2.53",
3
+ "version": "1.2.54",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",