Skip to content

Commit

Permalink
fix: 修复微信登录的一些bug
Browse files Browse the repository at this point in the history
  • Loading branch information
airingursb committed May 27, 2018
1 parent 950eae6 commit 64a4702
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 31 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
* Submit a pull request

## 2.0
### 2.0.4 / 2018-05-27

- 新增了微信登录
- 新增了用户反馈
- 新增了退出登录
- 新增了删除通知的功能
- 美化了样式
- 修复了情绪曲线的显示问题
- 修复了更新日记时多出空白图的 bug(感谢 @煜寒了 的pr)

### 2.0.3 / 2018-05-20

- 增加了对 emoji 的支持
Expand Down
15 changes: 0 additions & 15 deletions ios/twolife.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,6 @@
remoteGlobalIDString = 86D238421BD0BB9E00C75D01;
remoteInfo = RCTWeChat;
};
A0FB14E920BA7DB500E71FFF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 05901D607EDC466A94BCA43E /* RCTWeChat.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 10D6D7A41F160C250066F0F3;
remoteInfo = RCTWeChatTests;
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
Expand Down Expand Up @@ -878,7 +871,6 @@
isa = PBXGroup;
children = (
A0FB14E820BA7DB500E71FFF /* libRCTWeChat.a */,
A0FB14EA20BA7DB500E71FFF /* RCTWeChatTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -1372,13 +1364,6 @@
remoteRef = A0FB14E720BA7DB500E71FFF /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
A0FB14EA20BA7DB500E71FFF /* RCTWeChatTests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = RCTWeChatTests.xctest;
remoteRef = A0FB14E920BA7DB500E71FFF /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
Expand Down
14 changes: 7 additions & 7 deletions ios/twolife/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>wechat</string>
</array>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
Expand All @@ -22,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.3</string>
<string>2.0.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand All @@ -39,7 +34,12 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>3</string>
<string>1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixin</string>
<string>wechat</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
5 changes: 3 additions & 2 deletions src/containers/login/Gender.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ export default class Gender extends Component {
badges: -1
}
const res = await updateUser(this.props.user, data)

console.log(res)
if (res.code === 0) {
console.log(res)

JPushModule.setAlias(this.props.user.id.toString(), success => {
JPushModule.setAlias(res.data.user.id.toString(), success => {
console.log(success)
})

Expand Down
12 changes: 6 additions & 6 deletions src/containers/login/Options.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
WIDTH,
getResponsiveHeight,
} from '../../common/styles'
import { SCENE_LOGIN_SIGNIN, SCENE_LOGIN_SIGNUP, SCENE_LOGIN_NICKNAME } from '../../constants/scene'
import { SCENE_LOGIN_SIGNIN, SCENE_LOGIN_SIGNUP, SCENE_LOGIN_NICKNAME, SCENE_INDEX } from '../../constants/scene'
import Storage from '../../common/storage'

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

componentDidMount() {
WeChat.isWXAppInstalled().then(isWXAppInstalled => this.setState({ isWXAppInstalled: true }))
WeChat.isWXAppInstalled().then(isWXAppInstalled => this.setState({ isWXAppInstalled }))
}

wechat_login() {
Expand Down Expand Up @@ -65,10 +65,10 @@ export default class Options extends Component {
// 用户未绑定
if (res.code === 404) {
const openid = res.data
HttpUtils.post(USERS.bind_account, { account: openid, openid}).then(res => {
if (res.code === 0) {
Actions.reset(SCENE_LOGIN_NICKNAME, { user: res.data })
}
HttpUtils.post(USERS.bind_account, { account: openid, openid }).then(res => {
const { uid, token, timestamp } = res.key
setToken({ uid, token, timestamp })
Actions.reset(SCENE_LOGIN_NICKNAME, { user: res.data })
})
}
})
Expand Down

0 comments on commit 64a4702

Please sign in to comment.