Skip to content

Commit 64a4702

Browse files
committed
fix: 修复微信登录的一些bug
1 parent 950eae6 commit 64a4702

File tree

7 files changed

+27
-31
lines changed

7 files changed

+27
-31
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@
3838
* Submit a pull request
3939

4040
## 2.0
41+
### 2.0.4 / 2018-05-27
42+
43+
- 新增了微信登录
44+
- 新增了用户反馈
45+
- 新增了退出登录
46+
- 新增了删除通知的功能
47+
- 美化了样式
48+
- 修复了情绪曲线的显示问题
49+
- 修复了更新日记时多出空白图的 bug(感谢 @煜寒了 的pr)
50+
4151
### 2.0.3 / 2018-05-20
4252

4353
- 增加了对 emoji 的支持

ios/twolife.xcodeproj/project.pbxproj

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -396,13 +396,6 @@
396396
remoteGlobalIDString = 86D238421BD0BB9E00C75D01;
397397
remoteInfo = RCTWeChat;
398398
};
399-
A0FB14E920BA7DB500E71FFF /* PBXContainerItemProxy */ = {
400-
isa = PBXContainerItemProxy;
401-
containerPortal = 05901D607EDC466A94BCA43E /* RCTWeChat.xcodeproj */;
402-
proxyType = 2;
403-
remoteGlobalIDString = 10D6D7A41F160C250066F0F3;
404-
remoteInfo = RCTWeChatTests;
405-
};
406399
/* End PBXContainerItemProxy section */
407400

408401
/* Begin PBXCopyFilesBuildPhase section */
@@ -878,7 +871,6 @@
878871
isa = PBXGroup;
879872
children = (
880873
A0FB14E820BA7DB500E71FFF /* libRCTWeChat.a */,
881-
A0FB14EA20BA7DB500E71FFF /* RCTWeChatTests.xctest */,
882874
);
883875
name = Products;
884876
sourceTree = "<group>";
@@ -1372,13 +1364,6 @@
13721364
remoteRef = A0FB14E720BA7DB500E71FFF /* PBXContainerItemProxy */;
13731365
sourceTree = BUILT_PRODUCTS_DIR;
13741366
};
1375-
A0FB14EA20BA7DB500E71FFF /* RCTWeChatTests.xctest */ = {
1376-
isa = PBXReferenceProxy;
1377-
fileType = wrapper.cfbundle;
1378-
path = RCTWeChatTests.xctest;
1379-
remoteRef = A0FB14E920BA7DB500E71FFF /* PBXContainerItemProxy */;
1380-
sourceTree = BUILT_PRODUCTS_DIR;
1381-
};
13821367
/* End PBXReferenceProxy section */
13831368

13841369
/* Begin PBXResourcesBuildPhase section */

ios/twolife.xcodeproj/xcshareddata/xcschemes/twolife.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
</AdditionalOptions>
8282
</TestAction>
8383
<LaunchAction
84-
buildConfiguration = "Debug"
84+
buildConfiguration = "Release"
8585
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
8686
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
8787
language = ""

ios/twolife/Info.plist

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>LSApplicationQueriesSchemes</key>
6-
<array>
7-
<string>weixin</string>
8-
<string>wechat</string>
9-
</array>
105
<key>CFBundleDevelopmentRegion</key>
116
<string>en</string>
127
<key>CFBundleDisplayName</key>
@@ -22,7 +17,7 @@
2217
<key>CFBundlePackageType</key>
2318
<string>APPL</string>
2419
<key>CFBundleShortVersionString</key>
25-
<string>2.0.3</string>
20+
<string>2.0.4</string>
2621
<key>CFBundleSignature</key>
2722
<string>????</string>
2823
<key>CFBundleURLTypes</key>
@@ -39,7 +34,12 @@
3934
</dict>
4035
</array>
4136
<key>CFBundleVersion</key>
42-
<string>3</string>
37+
<string>1</string>
38+
<key>LSApplicationQueriesSchemes</key>
39+
<array>
40+
<string>weixin</string>
41+
<string>wechat</string>
42+
</array>
4343
<key>LSRequiresIPhoneOS</key>
4444
<true/>
4545
<key>NSAppTransportSecurity</key>

src/containers/login/Gender.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ export default class Gender extends Component {
4949
badges: -1
5050
}
5151
const res = await updateUser(this.props.user, data)
52-
52+
console.log(res)
5353
if (res.code === 0) {
54+
console.log(res)
5455

55-
JPushModule.setAlias(this.props.user.id.toString(), success => {
56+
JPushModule.setAlias(res.data.user.id.toString(), success => {
5657
console.log(success)
5758
})
5859

src/containers/login/Options.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
WIDTH,
2121
getResponsiveHeight,
2222
} from '../../common/styles'
23-
import { SCENE_LOGIN_SIGNIN, SCENE_LOGIN_SIGNUP, SCENE_LOGIN_NICKNAME } from '../../constants/scene'
23+
import { SCENE_LOGIN_SIGNIN, SCENE_LOGIN_SIGNUP, SCENE_LOGIN_NICKNAME, SCENE_INDEX } from '../../constants/scene'
2424
import Storage from '../../common/storage'
2525

2626
import HttpUtils from '../../network/HttpUtils'
@@ -34,7 +34,7 @@ export default class Options extends Component {
3434
}
3535

3636
componentDidMount() {
37-
WeChat.isWXAppInstalled().then(isWXAppInstalled => this.setState({ isWXAppInstalled: true }))
37+
WeChat.isWXAppInstalled().then(isWXAppInstalled => this.setState({ isWXAppInstalled }))
3838
}
3939

4040
wechat_login() {
@@ -65,10 +65,10 @@ export default class Options extends Component {
6565
// 用户未绑定
6666
if (res.code === 404) {
6767
const openid = res.data
68-
HttpUtils.post(USERS.bind_account, { account: openid, openid}).then(res => {
69-
if (res.code === 0) {
70-
Actions.reset(SCENE_LOGIN_NICKNAME, { user: res.data })
71-
}
68+
HttpUtils.post(USERS.bind_account, { account: openid, openid }).then(res => {
69+
const { uid, token, timestamp } = res.key
70+
setToken({ uid, token, timestamp })
71+
Actions.reset(SCENE_LOGIN_NICKNAME, { user: res.data })
7272
})
7373
}
7474
})

0 commit comments

Comments
 (0)