sso登录

This commit is contained in:
caoyang
2022-03-22 17:25:12 +08:00
parent 65c41bd9a4
commit 2e1d17e496
+10 -8
View File
@@ -59,7 +59,7 @@
</a-row> </a-row>
<a-row style="margin-bottom: 2%;"> <a-row style="margin-bottom: 2%;">
<a-col :span="3"></a-col> <a-col :span="3"></a-col>
<a-col :span="11"> <a-col :span="13">
<a-form-item> <a-form-item>
<a-checkbox v-decorator="['rememberMe', {initialValue: true, valuePropName: 'checked'}]">自动登录</a-checkbox> <a-checkbox v-decorator="['rememberMe', {initialValue: true, valuePropName: 'checked'}]">自动登录</a-checkbox>
</a-form-item> </a-form-item>
@@ -148,15 +148,15 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="10"> <a-col :span="13">
<a-form-item> <a-form-item>
<a-checkbox v-decorator="['rememberMe', {initialValue: true, valuePropName: 'checked'}]">自动登录</a-checkbox> <a-checkbox v-decorator="['rememberMe', {initialValue: true, valuePropName: 'checked'}]">自动登录</a-checkbox>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="4"> <a-col :span="6">
<!-- <a-form-item>--> <a-form-item>
<!-- <a-button>sso登录</a-button>--> <a-button type="primary" @click="ssoLogin">sso登录</a-button>
<!-- </a-form-item>--> </a-form-item>
</a-col> </a-col>
@@ -416,7 +416,7 @@
ssoLogin(){ ssoLogin(){
window.open('https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2F139.9.235.66%3A8010&response_type=code', '_blank') window.open('https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=http%3A%2F%2F139.9.235.66%3A8010&response_type=code', '_blank')
}, },
//sso登录成功 //sso登录
ssoLoginSuccess(){ ssoLoginSuccess(){
let that = this let that = this
let loginParams = {} let loginParams = {}
@@ -436,8 +436,10 @@
this.$store.commit('SET_NAME', { username: res.result.userInfo.username,realname: res.result.userInfo.realname, welcome: welcome() }) this.$store.commit('SET_NAME', { username: res.result.userInfo.username,realname: res.result.userInfo.realname, welcome: welcome() })
this.$store.commit('SET_AVATAR', res.result.userInfo.avatar) this.$store.commit('SET_AVATAR', res.result.userInfo.avatar)
this.loginSuccess() this.loginSuccess()
}else if(res.message=='【单点登录】获取用户profile失败'){
this.ssoLogin()
}else{ }else{
// this.ssoLogin() this.$message.error(res.message)
} }
}) })
}, },