Skip to content

Commit 0f73944

Browse files
committed
feat: 新增微信开放平台登录及绑定按钮
1 parent 6477a6d commit 0f73944

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

src/assets/icons/wechat.svg

Lines changed: 1 addition & 0 deletions
Loading

src/views/login/index.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
<a class="item" title="使用 GitHub 账号登录" @click="onOauth('github')">
3636
<GiSvgIcon name="github" :size="24" />
3737
</a>
38+
<a class="item" title="使用微信账号登录" @click="onOauth('wechat_open')">
39+
<GiSvgIcon name="wechat" :size="24" />
40+
</a>
3841
</div>
3942
</div>
4043
</div>
@@ -84,6 +87,9 @@
8487
<a v-if="tenantStore.isTenantConfigured" class="item" title="使用 GitHub 账号登录" @click="onOauth('github')">
8588
<GiSvgIcon name="github" :size="24" />
8689
</a>
90+
<a v-if="tenantStore.isTenantConfigured" class="item" title="使用微信账号登录" @click="onOauth('wechat_open')">
91+
<GiSvgIcon name="wechat" :size="24" />
92+
</a>
8793
</div>
8894
</div>
8995
</div>

src/views/user/profile/Social.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<a-card title="第三方账号" bordered class="gradient-card">
33
<div v-for="item in modeList" :key="item.title">
44
<div class="item">
5-
<div class="icon-wrapper"><GiSvgIcon :name="item.icon" :size="26" /></div>
5+
<GiSvgIcon :name="item.icon" :size="38" />
66
<div class="info">
77
<div class="info-top">
88
<span class="label">{{ item.title }}</span>
@@ -73,6 +73,14 @@ const initData = () => {
7373
jumpMode: 'link',
7474
status: socialList.value.includes('GITHUB'),
7575
},
76+
{
77+
title: '绑定微信',
78+
icon: 'wechat',
79+
subtitle: `${socialList.value.includes('WECHAT_OPEN') ? '' : '绑定后,'}可通过微信进行登录`,
80+
type: 'wechat_open',
81+
jumpMode: 'link',
82+
status: socialList.value.includes('WECHAT_OPEN'),
83+
},
7684
]
7785
})
7886
}

src/views/user/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export interface ModeItem {
33
icon: string
44
subtitle: string
55
value?: string
6-
type: 'phone' | 'email' | 'gitee' | 'github'
6+
type: 'phone' | 'email' | 'wechat_open' | 'gitee' | 'github'
77
jumpMode?: 'link' | 'modal'
88
status: boolean
99
statusString: string

0 commit comments

Comments
 (0)