Commit 6839c0dd by huqc

Merge remote-tracking branch 'origin/master'

parents 48548f48 8b847f86
...@@ -21,12 +21,10 @@ export function login(loginID, loginPas) { ...@@ -21,12 +21,10 @@ export function login(loginID, loginPas) {
export function getCode(yzm){ export function getCode(yzm){
var t = (new Date).getTime(); //每次点击重新取个随机数 var t = (new Date).getTime(); //每次点击重新取个随机数
return request({ return request({
url: 'http://192.168.3.110:8999/diseaseControlManage/api/login/captcha?t='+t+'&code='+yzm, url: 'http://192.168.3.110:8999/diseaseControlManage/api/login/verify?t='+t+'&code='+yzm,
method:'post', method:'post',
data: {},
async:false, //同步 async:false, //同步
}) })
} }
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
</template> </template>
<script> <script>
import {login, getCode} from '@/api/userlogin.js' import { getCode,login} from '@/api/userlogin.js'
export default { export default {
data() { data() {
...@@ -69,13 +69,16 @@ ...@@ -69,13 +69,16 @@
let _this = this let _this = this
// getCode(this.captcha_code).then(res=>{ getCode(this.captcha_code).then( res =>{
// console.log(res) console.log(res)
// }) console.log("登录报错!");
}).catch(err => {
// console.log("登录报错!");
})
// 用户登录 // 用户登录
login(this.loginID, this.$md5(this.loginPas)).then(res => { login(this.loginID, this.$md5(this.loginPas)).then(res => {
//login(this.loginID,this.loginPas).then( res=>{ //login(this.loginID,this.loginPas).then( res=>{
console.log(res)
if (res.code == 1) { if (res.code == 1) {
sessionStorage.setItem('token', res.data.token); sessionStorage.setItem('token', res.data.token);
sessionStorage.setItem('userinfo', JSON.stringify(res.data.userInfo)); sessionStorage.setItem('userinfo', JSON.stringify(res.data.userInfo));
...@@ -128,7 +131,7 @@ ...@@ -128,7 +131,7 @@
}, },
mounted() { mounted() {
this.$refs.code.setAttribute( this.$refs.code.setAttribute(
"src", 'http://192.168.3.110:8999/diseaseControlManage/api/login/captcha' "src", 'http://192.168.3.110:8999/diseaseControlManage/api/login/captcha'
); );
......
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