Authored by 孙凯

update uid bug review chenling

@@ -13,9 +13,14 @@ import { fetchShareCodeInfo } from '../groupPurchase/groupPurchaseActions'; @@ -13,9 +13,14 @@ import { fetchShareCodeInfo } from '../groupPurchase/groupPurchaseActions';
13 13
14 export function getUid() { 14 export function getUid() {
15 return async dispatch => { 15 return async dispatch => {
16 - let uid = await NativeModules.YH_CommonHelper.uid(); 16 + NativeModules.YH_CommonHelper.uid()
  17 + .then(uid => {
17 dispatch(setUid(uid)); 18 dispatch(setUid(uid));
18 dispatch(fetchShareCodeInfo()); 19 dispatch(fetchShareCodeInfo());
  20 + })
  21 + .catch(error => {
  22 + dispatch(fetchShareCodeInfo());
  23 + });
19 } 24 }
20 } 25 }
21 26
@@ -28,8 +33,12 @@ export function setUid(uid) { @@ -28,8 +33,12 @@ export function setUid(uid) {
28 33
29 export function getUnionType() { 34 export function getUnionType() {
30 return async dispatch => { 35 return async dispatch => {
31 - let unionType = await NativeModules.YH_CommonHelper.unionType();; 36 + NativeModules.YH_CommonHelper.unionType()
  37 + .then(uid => {
32 dispatch(setUnionType(unionType)) 38 dispatch(setUnionType(unionType))
  39 + })
  40 + .catch(error => {
  41 + });
33 } 42 }
34 } 43 }
35 44
@@ -7,7 +7,7 @@ let InitialState = Record({ @@ -7,7 +7,7 @@ let InitialState = Record({
7 host: 'http://api.yoho.cn', 7 host: 'http://api.yoho.cn',
8 serviceHost: 'http://api.yoho.cn', 8 serviceHost: 'http://api.yoho.cn',
9 unionType: '', 9 unionType: '',
10 - uid: '', 10 + uid: 0,
11 }); 11 });
12 12
13 export default InitialState; 13 export default InitialState;