parent
a969899286
commit
e3bb67c1b2
6 changed files with 123 additions and 6 deletions
@ -0,0 +1,67 @@ |
||||
<template> |
||||
<section> |
||||
<h2>欢迎访问智信链管理系统!</h2> |
||||
</section> |
||||
</template> |
||||
|
||||
<script> |
||||
import Utils from '@/common/js/utils.js'; |
||||
import {Login} from '@/api/server.js'; |
||||
|
||||
export default { |
||||
name: "YyyfLogin", |
||||
created() { |
||||
let loading = this.openLoading(); |
||||
this.initLogin(); |
||||
this.closeLoading(loading); |
||||
}, |
||||
mounted() { |
||||
}, |
||||
methods: { |
||||
/** |
||||
* 教师 学校管理员 超管 http://10.10.17.37:8080/#/yyyfLoginBack?userId=20776&userName=eWFuZmEwMw%3D%3D&userType=1&authorization=87DIVy348Oxzj3ha |
||||
* 1教师 2超管 3学校管理员 |
||||
*/ |
||||
initLogin() { |
||||
let params = Utils.parseUrl(); |
||||
let userType = params.userType; |
||||
Login.yyyfLogin(params).then(res => { |
||||
let {msg, code} = res; |
||||
if (code !== 200) { |
||||
this.$message({ |
||||
message: msg, |
||||
type: 'error' |
||||
}); |
||||
} else { |
||||
sessionStorage.setItem('user', JSON.stringify(res.data)); |
||||
sessionStorage.setItem('account',res.data.account); |
||||
sessionStorage.setItem('token', res.data.token); |
||||
if (userType == 1 || userType == 2) {//教师、超管 |
||||
this.$router.push({path: '/train'}); |
||||
}else{ |
||||
this.$router.replace({path: '/'}); |
||||
} |
||||
|
||||
} |
||||
}); |
||||
}, |
||||
//Loading加载 |
||||
openLoading() { |
||||
const loading = this.$loading({ |
||||
lock: true, |
||||
text: '正在跳转,请稍后!', |
||||
spinner: 'el-icon-loading', |
||||
background: 'rgba(0, 0, 0, 0.7)' |
||||
}); |
||||
return loading; |
||||
}, |
||||
closeLoading(loading){ |
||||
loading.close(); |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
|
||||
</style> |
Loading…
Reference in new issue