优化
This commit is contained in:
@@ -3,7 +3,7 @@ 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'
|
||||
export const PDA_ROLE = 'OVERSEAS_WAREHOUSE_PDA_OPERATOR'
|
||||
export const PDA_AUTHORITY = 'lastleg:pda:operate'
|
||||
|
||||
export const session = reactive({ currentUser: null, token: '', domesticToken: '', refreshToken: '', tenantId: '', apiBase: OVERSEAS_API_ROOT })
|
||||
@@ -61,7 +61,7 @@ export function validatePdaTokenPair(accessToken, overseasAccessToken) {
|
||||
}
|
||||
const warehouseId = claimId(overseas, 'overseas_warehouse_id')
|
||||
if (!/^\d+$/.test(warehouseId) || warehouseId === '0') throw new Error('海外PDA账号未绑定有效作业仓库')
|
||||
if (!includesClaim(overseas.roles, PDA_ROLE)) throw new Error('当前账号不是海外仓库拣货员')
|
||||
if (!includesClaim(overseas.roles, PDA_ROLE)) throw new Error('当前账号不是海外仓 PDA 作业员')
|
||||
if (!includesClaim(overseas.authorities, PDA_AUTHORITY)) throw new Error(`当前账号缺少${PDA_AUTHORITY}权限`)
|
||||
return { domestic, overseas, warehouseId }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user