Skip to content

Commit

Permalink
fix: bugs when log in with github
Browse files Browse the repository at this point in the history
  • Loading branch information
suyuan32 committed Oct 8, 2022
1 parent f971413 commit 1c06523
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/views/sys/login/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<Divider class="enter-x">{{ t('sys.login.otherSignIn') }}</Divider>

<div class="flex justify-evenly enter-x" :class="`${prefixCls}-sign-in-way`">
<GithubFilled />
<GithubFilled @click="oauthLoginHandler('github')" />
<WechatFilled />
<AlipayCircleFilled />
<GoogleCircleFilled @click="oauthLoginHandler('google')" />
Expand Down
4 changes: 4 additions & 0 deletions src/views/sys/oauth/callback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
<div></div>
</template>
<script lang="ts">
import { message } from 'ant-design-vue';
import { defineComponent, ref } from 'vue';
import { useRouter } from 'vue-router';
import { oauthLoginCallback } from '/@/api/sys/oauth';
import { PageEnum } from '/@/enums/pageEnum';
import { useI18n } from '/@/hooks/web/useI18n';
import { useGo } from '/@/hooks/web/usePage';
import { useUserStore } from '/@/store/modules/user';
Expand All @@ -15,6 +17,7 @@
setup() {
const { currentRoute } = useRouter();
const go = useGo();
const { t } = useI18n();
const query = ref<string>('');
query.value += '?state=' + currentRoute.value.query.state;
query.value += '&code=' + currentRoute.value.query.code;
Expand All @@ -29,6 +32,7 @@
userStore.afterLoginAction(false);
go(PageEnum.BASE_HOME);
} catch (e) {
message.error(t('sys.oauth.createAccount'), 5);
go(PageEnum.BASE_LOGIN);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/views/sys/oauth/oauth.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export const formSchema: FormSchema[] = [
component: 'Select',
componentProps: {
options: [
{ label: t('sys.oauth.autoDetect'), value: 0 },
{ label: t('sys.oauth.params'), value: 1 },
{ label: t('sys.oauth.header'), value: 2 },
],
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
],
},
server: {
https: false,
https: true,
// Listening on all local IPs
host: true,
port: VITE_PORT,
Expand Down

0 comments on commit 1c06523

Please sign in to comment.