|
|
@ -71,61 +71,23 @@ const selectTestUser = (item) => { |
|
|
// 直接触发登录 |
|
|
// 直接触发登录 |
|
|
doLogin(item.account, item.password); |
|
|
doLogin(item.account, item.password); |
|
|
} |
|
|
} |
|
|
// const doLogin = (secretName, secretKey) => { |
|
|
|
|
|
// const encryptedKey = Encrypt(secretKey); |
|
|
|
|
|
// enforcementLogin({code: '12346678985288799'}, response => { |
|
|
|
|
|
// if (response.code === 200) { |
|
|
|
|
|
// // // 验证关键组织信息 |
|
|
|
|
|
// // if (!response.data.deptId) { |
|
|
|
|
|
// // showFailToast("该用户未关联部门,无法登录"); |
|
|
|
|
|
// // return; |
|
|
|
|
|
// // } |
|
|
|
|
|
// // if (!response.data.organId) { |
|
|
|
|
|
// // showFailToast("该用户未关联认证机构,无法登录"); |
|
|
|
|
|
// // return; |
|
|
|
|
|
// // } |
|
|
|
|
|
// // if (!response.data.bureauUnitId) { |
|
|
|
|
|
// // showFailToast("该用户未关联执法单位,无法登录"); |
|
|
|
|
|
// // return; |
|
|
|
|
|
// // } |
|
|
|
|
|
// // 执法端登录成功 → 赋值用户基本信息 |
|
|
|
|
|
// useCommon.SET_USER_PHONENUMBER(response.data.phonenumber || ""); |
|
|
|
|
|
// useCommon.SET_USER_ID(response.data.userId); |
|
|
|
|
|
// useCommon.SET_USER_NAME(response.data.userName || ""); |
|
|
|
|
|
// useCommon.SET_NICK_NAME(response.data.nickName || ""); |
|
|
|
|
|
// useCommon.SET_TOKEN(response.data.token); |
|
|
|
|
|
// useCommon.SET_DEPT_ID(response.data.deptId); |
|
|
|
|
|
// useCommon.SET_DEPT_NAME(response.data.deptName || ""); |
|
|
|
|
|
// useCommon.SET_ORGAN_ID(response.data.organId); |
|
|
|
|
|
// useCommon.SET_ORGAN_NAME(response.data.organName || ""); |
|
|
|
|
|
// useCommon.SET_BUREAU_UNIT_ID(response.data.bureauUnitId); |
|
|
|
|
|
// useCommon.SET_BUREAU_UNIT_NAME(response.data.bureauUnitName || ""); |
|
|
|
|
|
// console.log("enforcement login success", useCommon.userId); |
|
|
|
|
|
// router.push({name: "enforcementHome"}); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// showFailToast(response.msg || "登录失败"); |
|
|
|
|
|
// } |
|
|
|
|
|
// }, error => { |
|
|
|
|
|
// showFailToast(error?.msg || "登录失败,请检查网络"); |
|
|
|
|
|
// }) |
|
|
|
|
|
// }; |
|
|
|
|
|
const doLogin = (secretName, secretKey) => { |
|
|
const doLogin = (secretName, secretKey) => { |
|
|
const encryptedKey = Encrypt(secretKey); |
|
|
const encryptedKey = Encrypt(secretKey); |
|
|
enforcementLogin({"secretName": secretName, "secretKey": encryptedKey}, response => { |
|
|
enforcementLogin({code: '12346678985288799'}, response => { |
|
|
if (response.code === 200) { |
|
|
if (response.code === 200) { |
|
|
// 验证关键组织信息 |
|
|
// // 验证关键组织信息 |
|
|
if (!response.data.deptId) { |
|
|
// if (!response.data.deptId) { |
|
|
showFailToast("该用户未关联部门,无法登录"); |
|
|
// showFailToast("该用户未关联部门,无法登录"); |
|
|
return; |
|
|
// return; |
|
|
} |
|
|
// } |
|
|
if (!response.data.organId) { |
|
|
// if (!response.data.organId) { |
|
|
showFailToast("该用户未关联认证机构,无法登录"); |
|
|
// showFailToast("该用户未关联认证机构,无法登录"); |
|
|
return; |
|
|
// return; |
|
|
} |
|
|
// } |
|
|
if (!response.data.bureauUnitId) { |
|
|
// if (!response.data.bureauUnitId) { |
|
|
showFailToast("该用户未关联执法单位,无法登录"); |
|
|
// showFailToast("该用户未关联执法单位,无法登录"); |
|
|
return; |
|
|
// return; |
|
|
} |
|
|
// } |
|
|
// 执法端登录成功 → 赋值用户基本信息 |
|
|
// 执法端登录成功 → 赋值用户基本信息 |
|
|
useCommon.SET_USER_PHONENUMBER(response.data.phonenumber || ""); |
|
|
useCommon.SET_USER_PHONENUMBER(response.data.phonenumber || ""); |
|
|
useCommon.SET_USER_ID(response.data.userId); |
|
|
useCommon.SET_USER_ID(response.data.userId); |
|
|
@ -147,6 +109,44 @@ const doLogin = (secretName, secretKey) => { |
|
|
showFailToast(error?.msg || "登录失败,请检查网络"); |
|
|
showFailToast(error?.msg || "登录失败,请检查网络"); |
|
|
}) |
|
|
}) |
|
|
}; |
|
|
}; |
|
|
|
|
|
// const doLogin = (secretName, secretKey) => { |
|
|
|
|
|
// const encryptedKey = Encrypt(secretKey); |
|
|
|
|
|
// enforcementLogin({"secretName": secretName, "secretKey": encryptedKey}, response => { |
|
|
|
|
|
// if (response.code === 200) { |
|
|
|
|
|
// // 验证关键组织信息 |
|
|
|
|
|
// if (!response.data.deptId) { |
|
|
|
|
|
// showFailToast("该用户未关联部门,无法登录"); |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// if (!response.data.organId) { |
|
|
|
|
|
// showFailToast("该用户未关联认证机构,无法登录"); |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// if (!response.data.bureauUnitId) { |
|
|
|
|
|
// showFailToast("该用户未关联执法单位,无法登录"); |
|
|
|
|
|
// return; |
|
|
|
|
|
// } |
|
|
|
|
|
// // 执法端登录成功 → 赋值用户基本信息 |
|
|
|
|
|
// useCommon.SET_USER_PHONENUMBER(response.data.phonenumber || ""); |
|
|
|
|
|
// useCommon.SET_USER_ID(response.data.userId); |
|
|
|
|
|
// useCommon.SET_USER_NAME(response.data.userName || ""); |
|
|
|
|
|
// useCommon.SET_NICK_NAME(response.data.nickName || ""); |
|
|
|
|
|
// useCommon.SET_TOKEN(response.data.token); |
|
|
|
|
|
// useCommon.SET_DEPT_ID(response.data.deptId); |
|
|
|
|
|
// useCommon.SET_DEPT_NAME(response.data.deptName || ""); |
|
|
|
|
|
// useCommon.SET_ORGAN_ID(response.data.organId); |
|
|
|
|
|
// useCommon.SET_ORGAN_NAME(response.data.organName || ""); |
|
|
|
|
|
// useCommon.SET_BUREAU_UNIT_ID(response.data.bureauUnitId); |
|
|
|
|
|
// useCommon.SET_BUREAU_UNIT_NAME(response.data.bureauUnitName || ""); |
|
|
|
|
|
// console.log("enforcement login success", useCommon.userId); |
|
|
|
|
|
// router.push({name: "enforcementHome"}); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// showFailToast(response.msg || "登录失败"); |
|
|
|
|
|
// } |
|
|
|
|
|
// }, error => { |
|
|
|
|
|
// showFailToast(error?.msg || "登录失败,请检查网络"); |
|
|
|
|
|
// }) |
|
|
|
|
|
// }; |
|
|
|
|
|
|
|
|
const onSubmit = async () => { |
|
|
const onSubmit = async () => { |
|
|
doLogin(loginParam.secretName, loginParam.secretKey); |
|
|
doLogin(loginParam.secretName, loginParam.secretKey); |
|
|
|