message-verify 1.0.0-beta.4 → 1.0.0-beta.5

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/index.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import ReactDOM from 'react-dom/client';
3
3
  import VerifyModal from './verify-modal.js';
4
4
  import Fingerprint2 from 'fingerprintjs2';
5
- export const initFingerprint = () => {
5
+ export const initFingerprint = async () => {
6
6
  return new Promise((resolve) => {
7
7
  Fingerprint2.get(function (components) {
8
8
  const includeKeys = ['userAgent', 'deviceMemory', 'cpuClass', 'hardwareConcurrency', 'platform'];
package/dist/main.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { createRoot } from 'react-dom/client';
3
- import { createMessageVerifyModal } from './index.js'; // 或 './index'
3
+ import { createMessageVerifyModal, initFingerprint } from './index.js'; // 或 './index'
4
4
  import { axios } from '@yqg/resource';
5
5
  const data = "{\"mobile\":\"188****4035\",\"verifyCodeKey\":\"3f025b33-988e-47c0-950d-6beb776d043f\",\"needValid\":true,\"step\":2,\"message\":\"需要填写验证码\"}";
6
+ const fp = await initFingerprint();
7
+ console.log(fp);
6
8
  createRoot(document.getElementById('root')).render(_jsx("button", { onClick: () => createMessageVerifyModal({
7
9
  data,
8
10
  config: { headers: {} },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.5",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/index.tsx CHANGED
@@ -3,7 +3,7 @@ import VerifyModal from './verify-modal.js'
3
3
  import Fingerprint2 from 'fingerprintjs2';
4
4
  import { ModalConfig } from './utils/type.js';
5
5
 
6
- export const initFingerprint = (): Promise<string> => {
6
+ export const initFingerprint = async (): Promise<string> => {
7
7
  return new Promise((resolve) => {
8
8
  Fingerprint2.get(function (components) {
9
9
  const includeKeys = ['userAgent', 'deviceMemory', 'cpuClass', 'hardwareConcurrency', 'platform'];
package/src/main.tsx CHANGED
@@ -1,9 +1,12 @@
1
1
  import { createRoot } from 'react-dom/client';
2
- import { createMessageVerifyModal } from './index.js'; // 或 './index'
2
+ import { createMessageVerifyModal, initFingerprint } from './index.js'; // 或 './index'
3
3
  import { axios } from '@yqg/resource';
4
4
 
5
5
  const data = "{\"mobile\":\"188****4035\",\"verifyCodeKey\":\"3f025b33-988e-47c0-950d-6beb776d043f\",\"needValid\":true,\"step\":2,\"message\":\"需要填写验证码\"}";
6
6
 
7
+ const fp = await initFingerprint();
8
+ console.log(fp);
9
+
7
10
  createRoot(document.getElementById('root')!).render(
8
11
  <button onClick={() => createMessageVerifyModal({
9
12
  data,