@@ -147,6 +147,7 @@ let loading // 加载动画
export default {
data () {
return {
+ isShowLogin: true,
i18nMessages: messages,
captchaPath: '',
dataForm: {
@@ -184,7 +185,13 @@ export default {
}
},
created () {
- this.getCaptcha()
+ //平阴联动平台 登陆
+ if (this.$route.query.platformToken) {
+ this.isShowLogin = false;
+ this.getAutoLogin(this.$route.query.platformToken)
+ }else{
+ this.getCaptcha()
+ }
},
methods: {
@@ -230,6 +237,25 @@ export default {
})
},
+ // 平阴联动 自动登录接口
+ getAutoLogin (platformToken) {
+ this.dataForm.thirdToken = platformToken;
+ this.dataForm.platform = "pyld";
+ this.$http.post(`/auth/sso/oper/third/login`,this.dataForm).then(({ data: res }) => {
+ if (res.code !== 0) {
+ if(res.code == 8302){
+ return this.$message.error(res.internalMsg)
+ }
+ return this.$message.error(res.msg)
+ }
+ localStorage.setItem('customerId', '613cc61a6b8ce4c70d21bd413dac72cc')
+ localStorage.setItem('userType', 'work')
+ localStorage.setItem('showHeader', '0')
+ Cookies.set('token', res.data.token)
+ this.$router.replace({ name: 'home' })
+ }).catch(() => { })
+ // epmet-ext9.elinkservice.cn/platform-admin
+ },
//选择客户
selectCustomer (row) {
localStorage.setItem('customerId', row.customerId)