|
@@ -10,8 +10,7 @@
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
|
|
|
-import Trottle from 'lodash/throttle'
|
|
|
|
-import { Component, Prop, Vue, Watch } from 'vue-property-decorator'
|
|
|
|
|
|
+import { Component, Prop, Vue } from 'vue-property-decorator'
|
|
import { getLoginMessageByGoogleIdToken } from '../assets/js/__message-util';
|
|
import { getLoginMessageByGoogleIdToken } from '../assets/js/__message-util';
|
|
|
|
|
|
@Component
|
|
@Component
|
|
@@ -19,68 +18,18 @@ export default class GoogleLogin extends Vue {
|
|
@Prop() public connection;
|
|
@Prop() public connection;
|
|
idToken: string = ''
|
|
idToken: string = ''
|
|
|
|
|
|
- // @Watch('connection')
|
|
|
|
- // updateConn(value, oldValue) {
|
|
|
|
- // console.log('updateconn')
|
|
|
|
- // this.conn = value
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
loginDisabled(){
|
|
loginDisabled(){
|
|
if ( this.idToken == null ) return true;
|
|
if ( this.idToken == null ) return true;
|
|
return this.idToken == null || this.connection.socketId == null
|
|
return this.idToken == null || this.connection.socketId == null
|
|
}
|
|
}
|
|
|
|
+
|
|
mounted(){
|
|
mounted(){
|
|
this.idToken = (new URLSearchParams(window.location.search)).get('id_token')
|
|
this.idToken = (new URLSearchParams(window.location.search)).get('id_token')
|
|
}
|
|
}
|
|
|
|
|
|
- // async startSession() {
|
|
|
|
- // const ucpId = await this.getResponse( getLoginMessageByGoogleIdToken(this.idToken, 10000), 'signin', (response) => {
|
|
|
|
- // console.log('response2', response)
|
|
|
|
- // const ucpId = response?.data?.ucpId
|
|
|
|
- // if( ucpId == null) throw Error('missing ucpId')
|
|
|
|
- // console.log('ucpId', ucpId)
|
|
|
|
- // return ucpId
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // getResponse = Trottle(async (request, operation: string, getReturnData: (response) => any ) => {
|
|
|
|
- // this.startLoading()
|
|
|
|
- // this.addMessage(operation + ' ...')
|
|
|
|
- // let returnData = null
|
|
|
|
- // try {
|
|
|
|
- // const results = await this.getResponses(request)
|
|
|
|
- // // look for error
|
|
|
|
- // const responseException = results.find( (r: any) => r?.header?.messageType == 'ResponseException' )
|
|
|
|
-
|
|
|
|
- // if( responseException != null ){
|
|
|
|
- // throw Error(responseException?.data)
|
|
|
|
- // }
|
|
|
|
- // // look for response
|
|
|
|
- // const response = results.find( (r: any) => {
|
|
|
|
- // const messageType = r?.header?.messageType
|
|
|
|
- // return ['FisResponse','Response'].indexOf(messageType) > -1
|
|
|
|
- // })
|
|
|
|
- // if(response == null){
|
|
|
|
- // throw Error('fail to get success response')
|
|
|
|
- // }
|
|
|
|
-
|
|
|
|
- // // try extract data
|
|
|
|
- // returnData = getReturnData(response)
|
|
|
|
-
|
|
|
|
- // this.addMessage(operation + ' success.')
|
|
|
|
- // } catch (error) {
|
|
|
|
- // this.addMessage(operation + ' fail :' + error)
|
|
|
|
- // }
|
|
|
|
- // this.endLoading()
|
|
|
|
-
|
|
|
|
- // console.log('results', returnData)
|
|
|
|
- // return returnData;
|
|
|
|
- // })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
loginUsingIdToken(){
|
|
loginUsingIdToken(){
|
|
this.$emit('loginAction',{
|
|
this.$emit('loginAction',{
|
|
- request: getLoginMessageByGoogleIdToken(this.idToken, 10000),
|
|
|
|
|
|
+ request: getLoginMessageByGoogleIdToken(this.idToken, 1000),
|
|
title: 'signin GoogleIdToken',
|
|
title: 'signin GoogleIdToken',
|
|
handle: (response) => {
|
|
handle: (response) => {
|
|
const ucpId = response?.data?.ucpId
|
|
const ucpId = response?.data?.ucpId
|
|
@@ -88,8 +37,6 @@ export default class GoogleLogin extends Vue {
|
|
return ucpId
|
|
return ucpId
|
|
}
|
|
}
|
|
})
|
|
})
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|