|
|
@@ -28,7 +28,7 @@
|
|
|
ref="loginForm"
|
|
|
label-position="left"
|
|
|
>
|
|
|
- <el-form-item prop="username">
|
|
|
+ <el-form-item prop="userName">
|
|
|
<span class="svg-container svg-container_login">
|
|
|
<svg-icon
|
|
|
icon-class="user"
|
|
|
@@ -36,9 +36,9 @@
|
|
|
/>
|
|
|
</span>
|
|
|
<el-input
|
|
|
- name="username"
|
|
|
+ name="userName"
|
|
|
type="text"
|
|
|
- v-model="loginForm.username"
|
|
|
+ v-model="loginForm.userName"
|
|
|
auto-complete="on"
|
|
|
placeholder="用户名或手机号"
|
|
|
/>
|
|
|
@@ -157,12 +157,12 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex'
|
|
|
-import { authsmsneed, authsmssend } from '@/api/login'
|
|
|
+import { authsmssend } from '@/api/login'
|
|
|
import readCard from '@/utils/readCard'
|
|
|
-import { Base64 } from 'js-base64'
|
|
|
+// import { Base64 } from 'js-base64'
|
|
|
import { encrypt } from '@/utils'
|
|
|
-const Store = require('electron-store')
|
|
|
-const localStore = new Store()
|
|
|
+// const Store = require('electron-store')
|
|
|
+// const localStore = new Store()
|
|
|
|
|
|
const { app } = require('electron').remote
|
|
|
const blocks = [
|
|
|
@@ -196,12 +196,12 @@ export default {
|
|
|
appName: this.$localStore.get('appName') || process.env.VUE_APP_PROJECT_NAME,
|
|
|
loginForm: {
|
|
|
projectName: '',
|
|
|
- username: '',
|
|
|
- password: '',
|
|
|
+ userName: 'admin',
|
|
|
+ password: 'Aa123456',
|
|
|
authcode: ''
|
|
|
},
|
|
|
loginRules: {
|
|
|
- username: [{ required: true, trigger: 'blur', message: '请输入用户名或手机号' }],
|
|
|
+ userName: [{ required: true, trigger: 'blur', message: '请输入用户名或手机号' }],
|
|
|
password: [{ required: true, trigger: 'blur', message: '请输入密码' }],
|
|
|
authcode: [{ required: true, trigger: 'blur', message: '请输入短信验证码' }]
|
|
|
},
|
|
|
@@ -213,11 +213,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
- authsmsneed().then(res => {
|
|
|
- if (res.extraInfo === '1') {
|
|
|
- this.showCode = true
|
|
|
- }
|
|
|
- })
|
|
|
+ // authsmsneed().then(res => {
|
|
|
+ // if (res.extraInfo === '1') {
|
|
|
+ // this.showCode = true
|
|
|
+ // }
|
|
|
+ // })
|
|
|
},
|
|
|
methods: {
|
|
|
openLink (url) {
|
|
|
@@ -237,12 +237,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getAuthCode (e) {
|
|
|
- if (!this.loginForm.username) {
|
|
|
+ if (!this.loginForm.userName) {
|
|
|
this.$message.error('请输入用户名或手机号')
|
|
|
return
|
|
|
}
|
|
|
this.authCodeDisable = true
|
|
|
- authsmssend({ username: this.loginForm.username }).then(res => {
|
|
|
+ authsmssend({ userName: this.loginForm.userName }).then(res => {
|
|
|
this.$message.success('发送成功。')
|
|
|
this.countDown()
|
|
|
}).catch(e => {
|
|
|
@@ -262,20 +262,21 @@ export default {
|
|
|
},
|
|
|
handleLogin () {
|
|
|
const params = {
|
|
|
- username: this.loginForm.username.trim(),
|
|
|
+ userName: this.loginForm.userName.trim(),
|
|
|
password: this.loginForm.password
|
|
|
}
|
|
|
- if (localStore.get('encryption')) {
|
|
|
- params.password = Base64.encode('CTICKET' + params.password)
|
|
|
- }
|
|
|
- if (localStore.get('encryption_aes')) {
|
|
|
- params.password = encrypt(params.password)
|
|
|
- }
|
|
|
- this.showCode && (params.authcode = this.loginForm.authcode)
|
|
|
+ // if (localStore.get('encryption')) {
|
|
|
+ // params.password = Base64.encode('CTICKET' + params.password)
|
|
|
+ // }
|
|
|
+ // if (localStore.get('encryption_aes')) {
|
|
|
+ // }
|
|
|
+ params.password = encrypt(params.password)
|
|
|
+ // params.password = 'f9106ac71ecb19ec1c4dfc6182198e9d'
|
|
|
+ // this.showCode && (params.authcode = this.loginForm.authcode)
|
|
|
|
|
|
this.$refs.loginForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- this.$log.info(`用户【${this.loginForm.username}】 登录操作`)
|
|
|
+ this.$log.info(`用户【${this.loginForm.userName}】 登录操作`)
|
|
|
|
|
|
this.loading = true
|
|
|
this.$store.dispatch('Login', params).then(() => {
|