|
@@ -25,6 +25,15 @@
|
|
</template>
|
|
</template>
|
|
</a-input>
|
|
</a-input>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
+
|
|
|
|
+ <a-form-item>
|
|
|
|
+ <JcRange
|
|
|
|
+ :status="status"
|
|
|
|
+ :successFun="onSuccess()"
|
|
|
|
+ :errorFun="onError()"
|
|
|
|
+ ></JcRange>
|
|
|
|
+ </a-form-item>
|
|
|
|
+
|
|
<a-form-item>
|
|
<a-form-item>
|
|
<a-button
|
|
<a-button
|
|
type="primary"
|
|
type="primary"
|
|
@@ -51,11 +60,15 @@ import { mapActions, mapGetters } from 'vuex'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
import { UserOutlined, LockOutlined } from '@ant-design/icons-vue'
|
|
import { UserOutlined, LockOutlined } from '@ant-design/icons-vue'
|
|
|
|
|
|
|
|
+import JcRange from './JcRange.vue'
|
|
|
|
+// import { ElMessage } from 'element-plus'
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
name: 'Login',
|
|
name: 'Login',
|
|
components: {
|
|
components: {
|
|
UserOutlined,
|
|
UserOutlined,
|
|
LockOutlined,
|
|
LockOutlined,
|
|
|
|
+ JcRange,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -63,6 +76,7 @@ export default {
|
|
username: '',
|
|
username: '',
|
|
password: '',
|
|
password: '',
|
|
},
|
|
},
|
|
|
|
+ status: false,
|
|
redirect: undefined,
|
|
redirect: undefined,
|
|
dependencies: dependencies,
|
|
dependencies: dependencies,
|
|
devDependencies: devDependencies,
|
|
devDependencies: devDependencies,
|
|
@@ -91,9 +105,6 @@ export default {
|
|
if (router.currentRoute.value.query.userName === 'admin') {
|
|
if (router.currentRoute.value.query.userName === 'admin') {
|
|
this.handleSubmit()
|
|
this.handleSubmit()
|
|
}
|
|
}
|
|
- // setTimeout(() => {
|
|
|
|
- // this.handleSubmit()
|
|
|
|
- // }, 3000)
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions({
|
|
...mapActions({
|
|
@@ -104,9 +115,28 @@ export default {
|
|
? '/'
|
|
? '/'
|
|
: this.redirect
|
|
: this.redirect
|
|
},
|
|
},
|
|
|
|
+ onSuccess() {
|
|
|
|
+ console.log('滑块成功')
|
|
|
|
+ this.status = true
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ onError() {
|
|
|
|
+ console.log('滑块失败')
|
|
|
|
+ this.status = false
|
|
|
|
+ },
|
|
|
|
+
|
|
async handleSubmit() {
|
|
async handleSubmit() {
|
|
- await this.login(this.form)
|
|
|
|
- await this.$router.push(this.handleRoute())
|
|
|
|
|
|
+ await this.login(this.form)
|
|
|
|
+ await this.$router.push(this.handleRoute())
|
|
|
|
+ // if (this.status) {
|
|
|
|
+ // await this.login(this.form)
|
|
|
|
+ // await this.$router.push(this.handleRoute())
|
|
|
|
+ // } else {
|
|
|
|
+ // ElMessage({
|
|
|
|
+ // message: '请先滑块验证',
|
|
|
|
+ // type: 'warning',
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -119,7 +149,7 @@ export default {
|
|
background-size: cover;
|
|
background-size: cover;
|
|
&-form {
|
|
&-form {
|
|
width: calc(100% - 40px);
|
|
width: calc(100% - 40px);
|
|
- height: 380px;
|
|
|
|
|
|
+ height: 440px;
|
|
padding: 4vh;
|
|
padding: 4vh;
|
|
margin-top: calc((100vh - 380px) / 2);
|
|
margin-top: calc((100vh - 380px) / 2);
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
@@ -160,3 +190,4 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
|
|
+l
|