|
@@ -93,7 +93,7 @@ import md5 from 'md5'
|
|
// import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha'
|
|
// import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha'
|
|
import { mapActions } from 'vuex'
|
|
import { mapActions } from 'vuex'
|
|
import SDialog from '@/components/Model'
|
|
import SDialog from '@/components/Model'
|
|
-// import { timeFix } from '@/utils/util'
|
|
|
|
|
|
+import { timeFix } from '@/utils/util'
|
|
// import { getSmsCaptcha, get2step } from '@/api/login'
|
|
// import { getSmsCaptcha, get2step } from '@/api/login'
|
|
// import { getVerifyCode } from '@/api/user'
|
|
// import { getVerifyCode } from '@/api/user'
|
|
export default {
|
|
export default {
|
|
@@ -188,7 +188,12 @@ export default {
|
|
loginParams.password = md5(loginParams.password)
|
|
loginParams.password = md5(loginParams.password)
|
|
const data = await Login(loginParams)
|
|
const data = await Login(loginParams)
|
|
console.log(data)
|
|
console.log(data)
|
|
- }
|
|
|
|
|
|
+ if (data.code === 200) {
|
|
|
|
+ this.loginSuccess()
|
|
|
|
+ } else {
|
|
|
|
+ this.visible = false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
|
|
// getCaptcha (e) {
|
|
// getCaptcha (e) {
|
|
// e.preventDefault()
|
|
// e.preventDefault()
|
|
@@ -233,29 +238,29 @@ export default {
|
|
// this.stepCaptchaVisible = false
|
|
// this.stepCaptchaVisible = false
|
|
// })
|
|
// })
|
|
// },
|
|
// },
|
|
- // loginSuccess (res) {
|
|
|
|
- // console.log(res)
|
|
|
|
|
|
+ loginSuccess () {
|
|
// check res.homePage define, set $router.push name res.homePage
|
|
// check res.homePage define, set $router.push name res.homePage
|
|
// Why not enter onComplete
|
|
// Why not enter onComplete
|
|
- /*
|
|
|
|
- this.$router.push({ name: 'analysis' }, () => {
|
|
|
|
- console.log('onComplete')
|
|
|
|
|
|
+
|
|
|
|
+ // this.$router.push({ name: 'analysis' }, () => {
|
|
|
|
+ // console.log('onComplete')
|
|
|
|
+ // this.$notification.success({
|
|
|
|
+ // message: '欢迎',
|
|
|
|
+ // description: `${timeFix()},欢迎回来`
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ // this.$router.push({ name: 'BasicForm' })
|
|
|
|
+ // console.log('hello')
|
|
|
|
+ this.$router.push('/operation')
|
|
|
|
+ // 延迟 1 秒显示欢迎信息
|
|
|
|
+ setTimeout(() => {
|
|
this.$notification.success({
|
|
this.$notification.success({
|
|
message: '欢迎',
|
|
message: '欢迎',
|
|
description: `${timeFix()},欢迎回来`
|
|
description: `${timeFix()},欢迎回来`
|
|
})
|
|
})
|
|
- })
|
|
|
|
- */
|
|
|
|
- // this.$router.push({ path: '/' })
|
|
|
|
- // 延迟 1 秒显示欢迎信息
|
|
|
|
- // setTimeout(() => {
|
|
|
|
- // this.$notification.success({
|
|
|
|
- // message: '欢迎',
|
|
|
|
- // description: `${timeFix()},欢迎回来`
|
|
|
|
- // })
|
|
|
|
- // }, 1000)
|
|
|
|
- // this.isLoginError = false
|
|
|
|
- // },
|
|
|
|
|
|
+ }, 1000)
|
|
|
|
+ this.isLoginError = false
|
|
|
|
+ }
|
|
// requestFailed (err) {
|
|
// requestFailed (err) {
|
|
// this.isLoginError = true
|
|
// this.isLoginError = true
|
|
// this.$notification['error']({
|
|
// this.$notification['error']({
|
|
@@ -265,6 +270,7 @@ export default {
|
|
// })
|
|
// })
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|