优化
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { reactive } from 'vue'
|
||||
import { RECEIVING_PHOTO_ROLES } from '@/api/receiving-adapter.js'
|
||||
import { RECEIVING_PHOTO_ROLES } from '../api/receiving-adapter.js'
|
||||
|
||||
export const receiving = reactive({
|
||||
candidates: [], selected: null, current: null, photoSlots: [null, null, null],
|
||||
@@ -53,6 +53,11 @@ export function resetReceivingDraft({ keepCurrent = false } = {}) {
|
||||
idempotencyKeys.clear()
|
||||
}
|
||||
|
||||
export function resetReceivingSession() {
|
||||
receiving.candidates = []
|
||||
resetReceivingDraft()
|
||||
}
|
||||
|
||||
export function idempotencyKey(action, payload = {}) {
|
||||
const signature = `${action}:${JSON.stringify(payload)}`
|
||||
if (!idempotencyKeys.has(signature)) idempotencyKeys.set(signature, `pda-${Date.now()}-${Math.random().toString(16).slice(2)}`)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { reactive } from 'vue'
|
||||
import { OVERSEAS_API_ROOT } from '../config/runtime.js'
|
||||
import { resetReceivingSession } from './receiving.js'
|
||||
|
||||
const SESSION_KEY = 'overseas-pda-auth-session'
|
||||
export const PDA_ROLE = 'WAREHOUSE_PICKER'
|
||||
@@ -158,6 +159,7 @@ export function signOut() {
|
||||
session.tenantId = ''
|
||||
session.apiBase = OVERSEAS_API_ROOT
|
||||
if (typeof uni !== 'undefined' && typeof uni.removeStorageSync === 'function') uni.removeStorageSync(SESSION_KEY)
|
||||
resetReceivingSession()
|
||||
}
|
||||
|
||||
export function requireSession() {
|
||||
|
||||
Reference in New Issue
Block a user