单点登录

master
liangliang.Li 3 years ago
parent f631f82d52
commit 02e7cd190f
  1. 9
      src/components/common/Header.vue
  2. 34
      src/components/page/ClientLogin.vue
  3. 11
      src/components/page/Index.vue
  4. 41
      src/components/page/Login.vue
  5. 2
      src/components/page/PersonalCenter.vue
  6. 2
      src/components/page/RegisterForm.vue
  7. 3
      src/router/index.js
  8. 1
      src/utils/api.js

@ -34,17 +34,12 @@ export default {
this.userName = userName
})
},
// computed: {
// username() {
// let username = sessionStorage.getItem('kd_client_username');
// return username ? username : this.name;
// }
// },
methods: {
loginout() {
this.$store.replaceState({})
sessionStorage.removeItem('kd_client_username');
location.reload()
this.$router.push('/login')
// location.reload()
},
toPersonalCenter(){
this.$router.push('/personalcenter')

@ -127,8 +127,6 @@ export default {
activeName: '0',
isReg: false,
loginForm: {
// username: '15794146134',
// password: '111aaa',
username: '',
password: '',
},
@ -164,13 +162,17 @@ export default {
phoneTimer: null,
newPassword: '',
emailOpener: '',
phoneOpener: ''
phoneOpener: '',
urlData:'',
type:'',
accountName:''
};
},
components: {
register
},
mounted(){
this.autoLogin()
this.$once('hook:beforeDestroy', function () {
clearInterval(this.phoneTimer)
this.phoneTimer = null
@ -179,6 +181,29 @@ export default {
})
},
methods: {
//type
//01
autoLogin(){
let currentUrl = window.location.href
let A = currentUrl.split('?')
let B = A[1].split('&')
B.forEach(item => {
if(item.includes('account')){
let account = item.split('=')
this.loginForm.username = account[1]
}
if(item.includes('type')){
let type = item.split('=')
this.type = type[1]
console.log(this.type);
}
})
if(this.type == '1'){
this.loginForm.password = 'Qw654321'
this.getSchool('loginForm')
}
},
backIndex(){
// this.$router.go(-1);
this.$router.push('login');
@ -224,9 +249,6 @@ export default {
});
},
getRole(form) {
// this.userId = this.schoolList.find((n,k) => {
// return n.schoolId == this.schoolId
// }).userId
let data = {
userId: this.userId,
schoolId: this.schoolId

@ -50,7 +50,9 @@ export default {
},
mounted() {
this.showChangePass()
},
methods:{
setPassword(){
if(this.regForm.password !== this.regForm.rePassword){
return this.$message.warning('两次输入的密码不一致,请重新输入')
@ -67,7 +69,12 @@ export default {
},
showChangePass(){
this.$get(this.api.isRequiredReset).then(res =>{
if(res.message && sessionStorage.getItem('kd_client_username').includes('专家')) this.changeVisible = true
if(this.$store.state.userName.includes('专家')){
}else{
if(res.message) this.changeVisible = true
}
}).catch(err=>{})
},
toFuture(){
@ -76,7 +83,7 @@ export default {
toNext(val) {
this.$router.push(`ProjectIntro?isFuture=${val}`)
},
}
};
</script>
<style lang="scss" scoped>

@ -71,18 +71,36 @@ export default {
this.accessNum()
},
methods:{
//
async userAuth(){
axios.interceptors.response.use(response => {
this.responseUrl = response.request.responseURL
return response;
}, error => {
return Promise.reject(error);
})
let rest = await this.$get(this.api.loginSchoolPerson)
window.location.href = this.responseUrl
console.log('res1=>',rest);
userAuth(){
location.href = 'https://finance.uestc.cn/liuwanr/userInfo/loginSchoolPerson'
// axios.interceptors.response.use(response => {
// // let res = JSON.parse(response.request.response)
// console.log('=>',response.request)
// // window.location.href = res.url
// return response;
// }, error => {
// return Promise.reject(error);
// })
// axios({
// url:'https://finance.uestc.cn/liuwanr/userInfo/loginSchoolPerson',
// method:'get',
// })
// this.$get(this.api.loginSchoolPerson).then(res =>{
// // window.location.href = res.url
// }).catch(err=>{})
},
//
// async userAuth(){
// let rest = await this.$get(this.api.loginSchoolPerson)
// window.location.href = rest.url
// // console.log('res1=>',rest);
// },
accessNum(){
this.$get(this.api.getAccessNum).then(res =>{
this.proAccessNum.currentNum = res.currentNum,
@ -91,7 +109,8 @@ export default {
}).catch(err=>{})
},
toClient(){
location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdclient/#/clientLogin' : 'https://finance.uestc.cn/kdclient/#/clientLogin'
// location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdclient/#/clientLogin?type=0' : 'https://finance.uestc.cn/kdclient/#/clientLogin?type=0'
this.$router.push(`/clientLogin?type=1&account=2017000000013`)
this.visiteShow = false
},
toMang(){

@ -10,7 +10,7 @@
:action="this.api.uploadUserAvatars"
:data="{userId:this.$store.state.userId}"
name="file"
:limit="3"
:limit="1"
:on-success="getRes"
>
<div>点击更改头像</div>

@ -124,7 +124,7 @@ export default {
methods: {
//
getVerificationCode(){
this.verifyCode = axios.defaults.baseURL + `/evaluation/tms/userInfo/getValidateCode?id=${Math.random()}`
this.verifyCode = `https://finance.uestc.cn/evaluation/tms/userInfo/getValidateCode?id=${Math.random()}`
},
getProvince(){
this.$get(this.api.queryProvince).then(res => {

@ -10,7 +10,8 @@ export default new Router({
{
path: '/',
redirect: '/login'
// redirect: '/index'
// redirect: '/dashboard'
// redirect: '/clientLogin'
},
{
path: '/teachingVideo',

@ -10,7 +10,6 @@ let host = ''
if(process.env.NODE_ENV === 'development'){
// host = 'https://finance.uestc.cn'
host = 'https://finance.uestc.cn'
axios.defaults.baseURL = location.host.includes('116.63.168.79') ? 'http://116.63.168.79' : 'https://finance.uestc.cn'
}
export default {

Loading…
Cancel
Save