|
@@ -18,7 +18,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
-import { loginApp } from '../../../../api/index.js'
|
|
|
|
|
|
|
+import { loginApp, getSsoUser } from '../../../../api/index.js'
|
|
|
export default {
|
|
export default {
|
|
|
components: {},
|
|
components: {},
|
|
|
name: 'Login',
|
|
name: 'Login',
|
|
@@ -30,7 +30,25 @@ export default {
|
|
|
hiddenBottom:false
|
|
hiddenBottom:false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- created() {},
|
|
|
|
|
|
|
+ created() {
|
|
|
|
|
+ var href = window.location.href
|
|
|
|
|
+ var idx = href.indexOf('code')
|
|
|
|
|
+ if (idx >= 0) {
|
|
|
|
|
+ const _this = this
|
|
|
|
|
+ var idx2 = href.indexOf("#")
|
|
|
|
|
+ var account = href.substring(idx + 'code'.length + 1, idx2)
|
|
|
|
|
+ getSsoUser({id:account})
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ sessionStorage.setItem('userInfo', JSON.stringify(res.data))
|
|
|
|
|
+ sessionStorage.setItem('x-token', res.data.jwtToken)
|
|
|
|
|
+ _this.$router.replace('/home')
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ alert('登录失败')
|
|
|
|
|
+ console.log(error)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
focusOn() {
|
|
focusOn() {
|
|
|
this.hiddenBottom = true
|
|
this.hiddenBottom = true
|