| | |
| | | const captchaId = ref('') |
| | | |
| | | const getCaptchaData = () => { |
| | | getCaptcha().then((rsp) => { |
| | | if (rsp.code == 200) { |
| | | captcha.value = rsp.data.picPath |
| | | captchaId.value = rsp.data.captchaId |
| | | } |
| | | getCaptcha().then((rsp: any) => { |
| | | captcha.value = rsp?.data?.picPath |
| | | captchaId.value = rsp?.data?.captchaId |
| | | }) |
| | | } |
| | | onMounted(() => { |
| | |
| | | password: ruleForm.pass, |
| | | captcha: ruleForm.code, |
| | | captchaId: captchaId.value |
| | | }).then((rsp) => { |
| | | if (rsp.code == 200) { |
| | | console.log(rsp) |
| | | setToken(rsp.data.token) |
| | | ElMessage({ |
| | | message: '登录成功!', |
| | | type: 'success' |
| | | }) |
| | | ruleForm.accountNumber = '' |
| | | ruleForm.pass = '' |
| | | ruleForm.code = '' |
| | | router.push('/') |
| | | } |
| | | }).then((rsp: any) => { |
| | | console.log(rsp) |
| | | setToken(rsp?.data?.token) |
| | | ElMessage({ |
| | | message: '登录成功!', |
| | | type: 'success' |
| | | }) |
| | | ruleForm.accountNumber = '' |
| | | ruleForm.pass = '' |
| | | ruleForm.code = '' |
| | | router.push('/') |
| | | }) |
| | | } else { |
| | | console.log('error submit!') |