Commit 81f9ddd6 authored by 刘洪铨's avatar 刘洪铨

登录

parent 7a35ed48
......@@ -11,7 +11,7 @@ export function login(username, password, code, uuid) {
return request({
url: '/auth/login',
method: 'post',
data: data,
params: data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
......
......@@ -42,8 +42,8 @@ const user = {
// const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password).then(res => {
setToken(res.token)
commit('SET_TOKEN', res.token)
setToken(res.data)
commit('SET_TOKEN', res.data)
resolve()
}).catch(error => {
reject(error)
......
......@@ -30,9 +30,9 @@
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<!--<div class="login-code">
<img :src="codeUrl" @click="getCode">
</div>
</div>-->
</el-form-item>
<el-form-item style="width:80%;margin-bottom: 20px">
<el-button
......@@ -65,7 +65,7 @@
</template>
<script>
import { getCodeImg } from '@/api/login'
// import { getCodeImg } from '@/api/login'
import Cookies from 'js-cookie'
import { encrypt, decrypt } from '@/utils/jsencrypt'
......@@ -77,8 +77,8 @@ export default {
codeUrl: '',
cookiePassword: '',
loginForm: {
username: 'admin',
password: 'admin123',
username: 'guanliyuan',
password: '123456',
rememberMe: false,
code: '',
uuid: ''
......@@ -96,7 +96,7 @@ export default {
}
},
created() {
this.getCode()
// this.getCode()
this.getCookie()
},
methods: {
......@@ -106,12 +106,12 @@ export default {
query: this.$route.query
})
},
getCode() {
/* getCode() {
getCodeImg().then(res => {
this.codeUrl = 'data:image/gif;base64,' + res.img
this.loginForm.uuid = res.uuid
})
},
},*/
getCookie() {
const username = Cookies.get('username')
const password = Cookies.get('password')
......@@ -144,7 +144,7 @@ export default {
})
.catch(() => {
this.loading = false
this.getCode()
// this.getCode()
})
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment