19 changed files with 639 additions and 178 deletions
@ -1,6 +1,6 @@ |
|||
{ |
|||
"sdk": { |
|||
"version": "6.0.201", |
|||
"version": "6.0.202", |
|||
"rollForward": "latestFeature" |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,24 @@ |
|||
using Newtonsoft.Json; |
|||
|
|||
namespace Lion.AbpPro.Users.Dtos; |
|||
|
|||
public class GithubAccessTokenResponse |
|||
{ |
|||
/// <summary>
|
|||
/// access_token
|
|||
/// </summary>
|
|||
[JsonProperty("access_token")] |
|||
public string Access_token { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// scope
|
|||
/// </summary>
|
|||
[JsonProperty("scope")] |
|||
public string Scope { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// token_type
|
|||
/// </summary>
|
|||
[JsonProperty("token_type")] |
|||
public string TokenType { get; set; } |
|||
} |
|||
@ -0,0 +1,99 @@ |
|||
namespace Lion.AbpPro.Users.Dtos; |
|||
|
|||
public class LoginGithubResponse |
|||
{ |
|||
public string login { get; set; } |
|||
|
|||
|
|||
public int id { get; set; } |
|||
|
|||
|
|||
public string node_id { get; set; } |
|||
|
|||
|
|||
public string avatar_url { get; set; } |
|||
|
|||
|
|||
public string gravatar_id { get; set; } |
|||
|
|||
|
|||
public string url { get; set; } |
|||
|
|||
|
|||
public string html_url { get; set; } |
|||
|
|||
|
|||
public string followers_url { get; set; } |
|||
|
|||
|
|||
public string following_url { get; set; } |
|||
|
|||
|
|||
public string gists_url { get; set; } |
|||
|
|||
|
|||
public string starred_url { get; set; } |
|||
|
|||
|
|||
public string subscriptions_url { get; set; } |
|||
|
|||
|
|||
public string organizations_url { get; set; } |
|||
|
|||
|
|||
public string repos_url { get; set; } |
|||
|
|||
|
|||
public string events_url { get; set; } |
|||
|
|||
|
|||
public string received_events_url { get; set; } |
|||
|
|||
|
|||
public string type { get; set; } |
|||
|
|||
|
|||
public string site_admin { get; set; } |
|||
|
|||
|
|||
public string name { get; set; } |
|||
|
|||
|
|||
public string company { get; set; } |
|||
|
|||
|
|||
public string blog { get; set; } |
|||
|
|||
|
|||
public string location { get; set; } |
|||
|
|||
|
|||
public string email { get; set; } |
|||
|
|||
|
|||
public string hireable { get; set; } |
|||
|
|||
|
|||
public string bio { get; set; } |
|||
|
|||
|
|||
public string twitter_username { get; set; } |
|||
|
|||
|
|||
public int public_repos { get; set; } |
|||
|
|||
|
|||
public int public_gists { get; set; } |
|||
|
|||
|
|||
public int followers { get; set; } |
|||
|
|||
|
|||
public int following { get; set; } |
|||
|
|||
|
|||
public string created_at { get; set; } |
|||
|
|||
|
|||
public string updated_at { get; set; } |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,46 @@ |
|||
<template> |
|||
<Loading :loading="loading" :absolute="absolute" :tip="tip" /> |
|||
</template> |
|||
<script lang="ts"> |
|||
import { defineComponent, reactive, toRefs } from 'vue'; |
|||
import { Loading } from '/@/components/Loading'; |
|||
import { useUserStore } from '/@/store/modules/user'; |
|||
import { useRouter } from 'vue-router'; |
|||
import { router } from '/@/router'; |
|||
import { PageEnum } from '/@/enums/pageEnum'; |
|||
import { message } from 'ant-design-vue'; |
|||
export default defineComponent({ |
|||
components: { Loading }, |
|||
setup() { |
|||
const compState = reactive({ |
|||
absolute: false, |
|||
loading: false, |
|||
tip: '登录中', |
|||
}); |
|||
const userStore = useUserStore(); |
|||
async function openLoading(absolute: boolean) { |
|||
compState.absolute = absolute; |
|||
compState.loading = true; |
|||
try { |
|||
debugger; |
|||
const { currentRoute } = useRouter(); |
|||
const code = currentRoute.value.fullPath.split('=')[1].split('&')[0]; |
|||
|
|||
if (code) { |
|||
await userStore.githubLogin(code); |
|||
} |
|||
} catch { |
|||
message.error('登陆失败'); |
|||
router.replace(PageEnum.BASE_HOME); |
|||
} finally { |
|||
compState.loading = false; |
|||
} |
|||
} |
|||
openLoading(true); |
|||
|
|||
return { |
|||
...toRefs(compState), |
|||
}; |
|||
}, |
|||
}); |
|||
</script> |
|||
Loading…
Reference in new issue