|
@@ -47,8 +47,11 @@
|
|
<script>
|
|
<script>
|
|
import StarBackground from '@/components/star'
|
|
import StarBackground from '@/components/star'
|
|
import {
|
|
import {
|
|
- getCodeImg,fontConfig
|
|
|
|
|
|
+ getCodeImg,fontConfig,getSecretKey
|
|
} from '@/api/login'
|
|
} from '@/api/login'
|
|
|
|
+ import {
|
|
|
|
+ encryptedData
|
|
|
|
+ } from '@/api/encrypt'
|
|
import Cookies from 'js-cookie'
|
|
import Cookies from 'js-cookie'
|
|
import {
|
|
import {
|
|
encrypt,
|
|
encrypt,
|
|
@@ -66,9 +69,10 @@
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
backgroudImg:require('../../assets/images/login/login-ty.jpg'), //背景图片
|
|
backgroudImg:require('../../assets/images/login/login-ty.jpg'), //背景图片
|
|
- systemTitle:{
|
|
|
|
- title:'通榆县乡村振兴综合监管平台', //标题
|
|
|
|
- subTitle:'数字应急' ,//副标题
|
|
|
|
|
|
+ systemTitle: {
|
|
|
|
+ title: '通榆县乡村振兴综合监管平台', //标题
|
|
|
|
+ subTitle: '数字应急',//副标题
|
|
|
|
+ },
|
|
codeUrl: '',
|
|
codeUrl: '',
|
|
loginForm: {
|
|
loginForm: {
|
|
username: 'admin',
|
|
username: 'admin',
|
|
@@ -113,7 +117,7 @@
|
|
created() {
|
|
created() {
|
|
this.getCode()
|
|
this.getCode()
|
|
this.getCookie()
|
|
this.getCookie()
|
|
- this.fontConfig();
|
|
|
|
|
|
+ this.fontConfig()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
fontConfig(){
|
|
fontConfig(){
|
|
@@ -164,19 +168,36 @@
|
|
Cookies.remove('password')
|
|
Cookies.remove('password')
|
|
Cookies.remove('rememberMe')
|
|
Cookies.remove('rememberMe')
|
|
}
|
|
}
|
|
- this.$store.dispatch('Login', this.loginForm).then(() => {
|
|
|
|
- console.log('!@!@!@', this.redirect)
|
|
|
|
- this.$router.push({
|
|
|
|
- //path: this.redirect || '/'
|
|
|
|
- path: '/'
|
|
|
|
- }).catch(() => {})
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.loading = false
|
|
|
|
- if (this.captchaOnOff) {
|
|
|
|
- this.getCode()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ // this.$store.dispatch('Login', this.loginForm).then(() => {
|
|
|
|
+ // console.log('!@!@!@', this.redirect)
|
|
|
|
+ // this.$router.push({
|
|
|
|
+ // //path: this.redirect || '/'
|
|
|
|
+ // path: '/'
|
|
|
|
+ // }).catch(() => {})
|
|
|
|
+ // }).catch(() => {
|
|
|
|
+ // this.loading = false
|
|
|
|
+ // if (this.captchaOnOff) {
|
|
|
|
+ // this.getCode()
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ //登录前先获取密码加密传输的公钥,对密码进行加密
|
|
|
|
+ getSecretKey().then(res => {
|
|
|
|
+ const encryptedPassword = encryptedData(res.data,this.loginForm.password);
|
|
|
|
+ this.loginForm.password = encryptedPassword;
|
|
|
|
+ this.$store.dispatch('Login', this.loginForm).then(() => {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ //path: this.redirect || '/'
|
|
|
|
+ path: '/'
|
|
|
|
+ })
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.loading = false
|
|
|
|
+ if (this.captchaOnOff) {
|
|
|
|
+ this.getCode()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|