@liujitcn/kratos-taro-app-core 0.0.32 → 0.0.33

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/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "type": "git",
8
8
  "url": "git@github.com:liujitcn/kratos-admin.git"
9
9
  },
10
- "version": "0.0.32",
10
+ "version": "0.0.33",
11
11
  "type": "module",
12
12
  "files": [
13
13
  "dist",
@@ -223,8 +223,8 @@ export async function encryptPassword(
223
223
  const publicKeyResponse = await defLoginService.PasswordPublicKey({ scene })
224
224
 
225
225
  const cryptoApi = globalThis.crypto
226
- // 微信小程序和局域网 HTTP 页面没有 WebCrypto,使用纯 JavaScript 实现保持协议一致。
227
- if (process.env.TARO_ENV === 'weapp' || !cryptoApi?.subtle) {
226
+ const isSecureContext = typeof window === 'undefined' || window.isSecureContext
227
+ if (process.env.TARO_ENV === 'weapp' || !cryptoApi?.subtle || !isSecureContext) {
228
228
  return encryptPortablePassword(miniCrypto, plainPassword, publicKeyResponse)
229
229
  }
230
230