|
@@ -133,13 +133,15 @@
|
|
import { cookieUserId, cookieTime, cookieUserName } from '@/config/config.js';
|
|
import { cookieUserId, cookieTime, cookieUserName } from '@/config/config.js';
|
|
import { setCookie, getCookie, formatDate } from '@/utils/util.js';
|
|
import { setCookie, getCookie, formatDate } from '@/utils/util.js';
|
|
import store from '@/store/index.js';
|
|
import store from '@/store/index.js';
|
|
-
|
|
|
|
|
|
+import JsSHA from 'jssha'
|
|
|
|
+const shaObj = new JsSHA('SHA-1', 'TEXT', { encoding: 'UTF8' })
|
|
export default {
|
|
export default {
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
store,
|
|
store,
|
|
loginBtnLoading: false,
|
|
loginBtnLoading: false,
|
|
pwdShow: false,
|
|
pwdShow: false,
|
|
|
|
+ shaObj,
|
|
loginForm: {
|
|
loginForm: {
|
|
loginName: '',
|
|
loginName: '',
|
|
password: '',
|
|
password: '',
|
|
@@ -203,7 +205,9 @@ export default {
|
|
// /*
|
|
// /*
|
|
// 登陆中 登录按钮不可用
|
|
// 登陆中 登录按钮不可用
|
|
this.loginBtnLoading = true;
|
|
this.loginBtnLoading = true;
|
|
- let form = this.loginForm;
|
|
|
|
|
|
+ let form = JSON.parse(JSON.stringify(this.loginForm));
|
|
|
|
+ this.shaObj.update(form.password)
|
|
|
|
+ form.password = this.shaObj.getHash('HEX')
|
|
this.store.dispatch('index/login/login', form).then(res => {
|
|
this.store.dispatch('index/login/login', form).then(res => {
|
|
if (res.code === '0') {
|
|
if (res.code === '0') {
|
|
// 登录成功
|
|
// 登录成功
|