fix: 登录兼容联通19位
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Change: Retry 19-digit ICCID login with a Luhn check digit
|
||||
|
||||
## Why
|
||||
|
||||
Some IoT cards are entered or scanned as a 19-digit ICCID prefix. The asset-verification endpoint requires the 20-digit ICCID, so the first verification cannot return an asset token even though the identifier can be deterministically completed.
|
||||
|
||||
## What Changes
|
||||
|
||||
- When a login identifier is exactly 19 numeric characters and starts with `89`, call `/api/c/v1/auth/verify-asset` with the entered value first.
|
||||
- If that first request fails or does not return `asset_token`, compute the twentieth digit with the ISO/IEC 7812 Luhn (mod-10) check-digit algorithm and retry verification once using the completed ICCID.
|
||||
- Keep the first failure entirely silent to the customer. Only the retry failure is handled by the existing login error flow.
|
||||
- Persist and use the successful 20-digit ICCID for the authenticated session without mutating the text in the input field during the silent retry.
|
||||
|
||||
## Impact
|
||||
|
||||
- Affected capability: `iccid-login-check-digit-retry` (new)
|
||||
- Affected code: `pages/login/login.vue`
|
||||
- Affected API: `POST /api/c/v1/auth/verify-asset`
|
||||
- No backend API, request payload shape, or shared error handling is changed.
|
||||
@@ -0,0 +1,31 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Silent 19-digit ICCID verification retry
|
||||
|
||||
When an asset login identifier matches `^89\\d{17}$`, the H5 client SHALL first verify the entered 19-digit value. If that attempt fails or does not return a non-empty `asset_token`, it SHALL calculate the ISO/IEC 7812 Luhn mod-10 check digit, append it as the twentieth digit, and verify the completed ICCID exactly once.
|
||||
|
||||
#### Scenario: Completed ICCID succeeds
|
||||
|
||||
- **WHEN** a customer enters a 19-digit numeric identifier beginning with `89`
|
||||
- **AND** the initial verification does not provide an asset token
|
||||
- **AND** verification of the Luhn-completed 20-digit ICCID returns an asset token
|
||||
- **THEN** the customer continues through login without seeing an error from the first verification
|
||||
- **AND** the authenticated session uses the 20-digit ICCID
|
||||
|
||||
#### Scenario: Initial verification succeeds
|
||||
|
||||
- **WHEN** a customer enters a 19-digit numeric identifier beginning with `89`
|
||||
- **AND** initial verification returns an asset token
|
||||
- **THEN** the client SHALL not calculate or submit a second identifier
|
||||
|
||||
#### Scenario: Completed ICCID fails
|
||||
|
||||
- **WHEN** the Luhn-completed retry does not return an asset token
|
||||
- **THEN** the client SHALL invoke the existing login failure presentation once using the retry failure
|
||||
|
||||
#### Scenario: Identifier is not a 19-digit ICCID prefix
|
||||
|
||||
- **WHEN** an identifier does not match `^89\\d{17}$`
|
||||
- **AND** verification fails or does not return an asset token
|
||||
- **THEN** the client SHALL not issue a retry
|
||||
- **AND** SHALL retain the existing login failure presentation
|
||||
10
openspec/changes/add-iccid-login-check-digit-retry/tasks.md
Normal file
10
openspec/changes/add-iccid-login-check-digit-retry/tasks.md
Normal file
@@ -0,0 +1,10 @@
|
||||
## 1. Login fallback
|
||||
|
||||
- [x] 1.1 Add a pure ISO/IEC 7812 Luhn mod-10 check-digit helper for a 19-digit ICCID prefix.
|
||||
- [x] 1.2 Retry asset verification once and silently only when the initial identifier matches `^89\\d{17}$` and the first verification fails or lacks `asset_token`.
|
||||
- [x] 1.3 Persist the completed ICCID only after the retry succeeds; retain the existing visible error path for all final failures and non-matching identifiers.
|
||||
|
||||
## 2. Verification
|
||||
|
||||
- [x] 2.1 Verify known Luhn vectors plus first-attempt success, fallback success, fallback failure, and non-ICCID failure behavior.
|
||||
- [x] 2.2 Run the H5 production build.
|
||||
Reference in New Issue
Block a user