Compare commits
7 Commits
Author | SHA1 | Date |
---|---|---|
CherrysChang | 8d657c2990 | 4 years ago |
Qian | f8bfdf44f5 | 4 years ago |
Qian | 1497bf6c9e | 4 years ago |
CherrysChang | 60c0689f69 | 5 years ago |
Qian | fe00be0f6e | 5 years ago |
CherrysChang | e3bb67c1b2 | 5 years ago |
CherrysChang | a969899286 | 5 years ago |
10 changed files with 254 additions and 41 deletions
@ -0,0 +1,90 @@ |
||||
<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); |
||||
}, |
||||
methods: { |
||||
/** |
||||
* 教师 学校管理员 超管 http://localhost:8080/#/yyyfLoginBack?userId=1&userName=eWFuZmEwMw%3D%3D&userType=1 |
||||
* 1教师 2超管 ==> 案例管理 |
||||
* 3学校管理员 ==> 后台管理 |
||||
*/ |
||||
initLogin() { |
||||
let params = Utils.parseUrl(); |
||||
let self = this; |
||||
//判断是否来自以渔有方 |
||||
if (params!==undefined && params !=null && params.userId != undefined && params.userType != undefined) { |
||||
let userType = params.userType; |
||||
Login.yyyfLogin(params).then(res => { |
||||
let {msg, code} = res; |
||||
if (code !== 200) { |
||||
self.$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) {//教师、超管 |
||||
self.$router.push({path: '/train'}); |
||||
}else{ |
||||
window.location.reload(); |
||||
} |
||||
|
||||
} |
||||
}); |
||||
} else { |
||||
self.$alert('参数错误', '提示', { |
||||
type: 'error', |
||||
showClose: false, |
||||
confirmButtonText: '确定', |
||||
confirmButtonClass: 'btn-self-style', |
||||
callback: action => { |
||||
self.closeWindow() |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
//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(); |
||||
}, |
||||
closeWindow: function () { |
||||
if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1) { |
||||
window.location.href = "about:blank"; |
||||
window.close(); |
||||
} else { |
||||
window.opener = null; |
||||
window.open("", "_self"); |
||||
window.close(); |
||||
} |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
|
||||
</style> |
Loading…
Reference in new issue