Skip to content

Commit 923ac70

Browse files
committed
fix: api->login
1 parent c222851 commit 923ac70

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

pages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
{
215215
"path": "pages/API/login/login",
216216
"style": {
217-
"navigationBarTitleText": "微信登录"
217+
"navigationBarTitleText": "授权登录"
218218
}
219219
},
220220
{

pages/API/login/login.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<block v-if="hasLogin === true">
77
<view class="uni-h3 uni-center uni-common-mt">已登录</view>
88
<view class="uni-hello-text uni-center">
9-
<text>每个帐号仅需登录 1 次,\n后续每次进入页面即可自动拉取用户信息。</text>
9+
<text>每个账号仅需登录 1 次,\n后续每次进入页面即可自动拉取用户信息。</text>
1010
</view>
1111
</block>
1212
<block v-if="hasLogin === false">
@@ -40,7 +40,7 @@
4040
},
4141
onLoad() {
4242
uni.getProvider({
43-
service: "oauth",
43+
service: 'oauth',
4444
success: (e) => {
4545
console.log('oauth..........');
4646
this.providerList = e.provider.map((value) => {
@@ -61,6 +61,9 @@
6161
case 'baidu':
6262
providerName = '百度登录'
6363
break;
64+
case 'alipay':
65+
providerName = '支付宝登录'
66+
break;
6467
}
6568
return {
6669
name: providerName,
@@ -80,12 +83,13 @@
8083
provider: provider.id,
8184
success: (res) => {
8285
console.log('login success:', res);
83-
this.login(provider.id); //改变保存在store里的登录状态
86+
// 更新保存在 store 中的登录状态
87+
this.login(provider.id);
8488
},
8589
fail: (err) => {
8690
console.log('login fail:', err);
8791
}
88-
})
92+
});
8993
}
9094
}
9195
}

0 commit comments

Comments
 (0)