Authored by shixiang

完成登录接口调试

review-叶弯弯
@@ -44,4 +44,6 @@ SPEC CHECKSUMS: @@ -44,4 +44,6 @@ SPEC CHECKSUMS:
44 React: 386bbe687faee56ab75bad6132813945d5857403 44 React: 386bbe687faee56ab75bad6132813945d5857403
45 RNDeviceInfo: e3fe8d8fe52f74eab22b7d4784a4fdd2e9bf4a26 45 RNDeviceInfo: e3fe8d8fe52f74eab22b7d4784a4fdd2e9bf4a26
46 46
47 -COCOAPODS: 0.39.0 47 +PODFILE CHECKSUM: 204359fbddc735210f82703c7a0dbd08c58273a5
  48 +
  49 +COCOAPODS: 1.0.0
@@ -12,9 +12,9 @@ @@ -12,9 +12,9 @@
12 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 12 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
14 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 14 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
  15 + 2D6F93DC42758ED618A4ED3F /* libPods-YH_Vendor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2312FCCC9319C46CC691BBAA /* libPods-YH_Vendor.a */; };
15 875F164E1CCF71820051CA82 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 875F164D1CCF71820051CA82 /* libReact.a */; }; 16 875F164E1CCF71820051CA82 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 875F164D1CCF71820051CA82 /* libReact.a */; };
16 87D1E5321CEC1BC70050ADA3 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87D1E5311CEC1BC70050ADA3 /* libRNDeviceInfo.a */; }; 17 87D1E5321CEC1BC70050ADA3 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87D1E5311CEC1BC70050ADA3 /* libRNDeviceInfo.a */; };
17 - BDB44E315EC65A19AFDFE3D5 /* libPods-YH_Vendor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A5497DA9F4E284B45CC00DB9 /* libPods-YH_Vendor.a */; };  
18 /* End PBXBuildFile section */ 18 /* End PBXBuildFile section */
19 19
20 /* Begin PBXContainerItemProxy section */ 20 /* Begin PBXContainerItemProxy section */
@@ -39,11 +39,11 @@ @@ -39,11 +39,11 @@
39 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = YH_Vendor/Images.xcassets; sourceTree = "<group>"; }; 39 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = YH_Vendor/Images.xcassets; sourceTree = "<group>"; };
40 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = YH_Vendor/Info.plist; sourceTree = "<group>"; }; 40 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = YH_Vendor/Info.plist; sourceTree = "<group>"; };
41 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = YH_Vendor/main.m; sourceTree = "<group>"; }; 41 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = YH_Vendor/main.m; sourceTree = "<group>"; };
  42 + 2312FCCC9319C46CC691BBAA /* libPods-YH_Vendor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-YH_Vendor.a"; sourceTree = BUILT_PRODUCTS_DIR; };
  43 + 32146CF42F1683ED997A873A /* Pods-YH_Vendor.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YH_Vendor.release.xcconfig"; path = "Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor.release.xcconfig"; sourceTree = "<group>"; };
42 875F164D1CCF71820051CA82 /* libReact.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libReact.a; path = "Pods/../build/Debug-iphoneos/libReact.a"; sourceTree = "<group>"; }; 44 875F164D1CCF71820051CA82 /* libReact.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libReact.a; path = "Pods/../build/Debug-iphoneos/libReact.a"; sourceTree = "<group>"; };
43 87D1E5311CEC1BC70050ADA3 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRNDeviceInfo.a; path = "Pods/../build/Debug-iphoneos/libRNDeviceInfo.a"; sourceTree = "<group>"; }; 45 87D1E5311CEC1BC70050ADA3 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRNDeviceInfo.a; path = "Pods/../build/Debug-iphoneos/libRNDeviceInfo.a"; sourceTree = "<group>"; };
44 - A5497DA9F4E284B45CC00DB9 /* libPods-YH_Vendor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-YH_Vendor.a"; sourceTree = BUILT_PRODUCTS_DIR; };  
45 - B44EE6A85A06E0E02E6B1F23 /* Pods-YH_Vendor.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YH_Vendor.release.xcconfig"; path = "Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor.release.xcconfig"; sourceTree = "<group>"; };  
46 - E38B39E1C626434D633DF86C /* Pods-YH_Vendor.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YH_Vendor.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor.debug.xcconfig"; sourceTree = "<group>"; }; 46 + F573E9D3010460361AD8AE1C /* Pods-YH_Vendor.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YH_Vendor.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor.debug.xcconfig"; sourceTree = "<group>"; };
47 /* End PBXFileReference section */ 47 /* End PBXFileReference section */
48 48
49 /* Begin PBXFrameworksBuildPhase section */ 49 /* Begin PBXFrameworksBuildPhase section */
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 files = ( 60 files = (
61 87D1E5321CEC1BC70050ADA3 /* libRNDeviceInfo.a in Frameworks */, 61 87D1E5321CEC1BC70050ADA3 /* libRNDeviceInfo.a in Frameworks */,
62 875F164E1CCF71820051CA82 /* libReact.a in Frameworks */, 62 875F164E1CCF71820051CA82 /* libReact.a in Frameworks */,
63 - BDB44E315EC65A19AFDFE3D5 /* libPods-YH_Vendor.a in Frameworks */, 63 + 2D6F93DC42758ED618A4ED3F /* libPods-YH_Vendor.a in Frameworks */,
64 ); 64 );
65 runOnlyForDeploymentPostprocessing = 0; 65 runOnlyForDeploymentPostprocessing = 0;
66 }; 66 };
@@ -103,20 +103,11 @@ @@ -103,20 +103,11 @@
103 children = ( 103 children = (
104 87D1E5311CEC1BC70050ADA3 /* libRNDeviceInfo.a */, 104 87D1E5311CEC1BC70050ADA3 /* libRNDeviceInfo.a */,
105 875F164D1CCF71820051CA82 /* libReact.a */, 105 875F164D1CCF71820051CA82 /* libReact.a */,
106 - A5497DA9F4E284B45CC00DB9 /* libPods-YH_Vendor.a */, 106 + 2312FCCC9319C46CC691BBAA /* libPods-YH_Vendor.a */,
107 ); 107 );
108 name = Frameworks; 108 name = Frameworks;
109 sourceTree = "<group>"; 109 sourceTree = "<group>";
110 }; 110 };
111 - 781FD8062D98B64732E2C79B /* Pods */ = {  
112 - isa = PBXGroup;  
113 - children = (  
114 - E38B39E1C626434D633DF86C /* Pods-YH_Vendor.debug.xcconfig */,  
115 - B44EE6A85A06E0E02E6B1F23 /* Pods-YH_Vendor.release.xcconfig */,  
116 - );  
117 - name = Pods;  
118 - sourceTree = "<group>";  
119 - };  
120 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 111 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
121 isa = PBXGroup; 112 isa = PBXGroup;
122 children = ( 113 children = (
@@ -131,8 +122,8 @@ @@ -131,8 +122,8 @@
131 832341AE1AAA6A7D00B99B32 /* Libraries */, 122 832341AE1AAA6A7D00B99B32 /* Libraries */,
132 00E356EF1AD99517003FC87E /* YH_VendorTests */, 123 00E356EF1AD99517003FC87E /* YH_VendorTests */,
133 83CBBA001A601CBA00E9B192 /* Products */, 124 83CBBA001A601CBA00E9B192 /* Products */,
134 - 781FD8062D98B64732E2C79B /* Pods */,  
135 4629C9058F02534B1365A58F /* Frameworks */, 125 4629C9058F02534B1365A58F /* Frameworks */,
  126 + 9FC0A2904AC5F3ADEEEDB88C /* Pods */,
136 ); 127 );
137 indentWidth = 2; 128 indentWidth = 2;
138 sourceTree = "<group>"; 129 sourceTree = "<group>";
@@ -147,6 +138,15 @@ @@ -147,6 +138,15 @@
147 name = Products; 138 name = Products;
148 sourceTree = "<group>"; 139 sourceTree = "<group>";
149 }; 140 };
  141 + 9FC0A2904AC5F3ADEEEDB88C /* Pods */ = {
  142 + isa = PBXGroup;
  143 + children = (
  144 + F573E9D3010460361AD8AE1C /* Pods-YH_Vendor.debug.xcconfig */,
  145 + 32146CF42F1683ED997A873A /* Pods-YH_Vendor.release.xcconfig */,
  146 + );
  147 + name = Pods;
  148 + sourceTree = "<group>";
  149 + };
150 /* End PBXGroup section */ 150 /* End PBXGroup section */
151 151
152 /* Begin PBXNativeTarget section */ 152 /* Begin PBXNativeTarget section */
@@ -172,13 +172,13 @@ @@ -172,13 +172,13 @@
172 isa = PBXNativeTarget; 172 isa = PBXNativeTarget;
173 buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "YH_Vendor" */; 173 buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "YH_Vendor" */;
174 buildPhases = ( 174 buildPhases = (
175 - B323DDDC1CCFDE05561C14D4 /* Check Pods Manifest.lock */, 175 + 001B27FDA35CD5717A740787 /* 📦 Check Pods Manifest.lock */,
176 13B07F871A680F5B00A75B9A /* Sources */, 176 13B07F871A680F5B00A75B9A /* Sources */,
177 13B07F8C1A680F5B00A75B9A /* Frameworks */, 177 13B07F8C1A680F5B00A75B9A /* Frameworks */,
178 13B07F8E1A680F5B00A75B9A /* Resources */, 178 13B07F8E1A680F5B00A75B9A /* Resources */,
179 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 179 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
180 - 1FDAA1517B73CCED81A0B7BF /* Embed Pods Frameworks */,  
181 - BF65CB909474B53921DEDF7E /* Copy Pods Resources */, 180 + DCCB17D41CAF2C27BC937F1E /* 📦 Embed Pods Frameworks */,
  181 + 406E3ABF16326E848AFE2A52 /* 📦 Copy Pods Resources */,
182 ); 182 );
183 buildRules = ( 183 buildRules = (
184 ); 184 );
@@ -243,63 +243,63 @@ @@ -243,63 +243,63 @@
243 /* End PBXResourcesBuildPhase section */ 243 /* End PBXResourcesBuildPhase section */
244 244
245 /* Begin PBXShellScriptBuildPhase section */ 245 /* Begin PBXShellScriptBuildPhase section */
246 - 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 246 + 001B27FDA35CD5717A740787 /* 📦 Check Pods Manifest.lock */ = {
247 isa = PBXShellScriptBuildPhase; 247 isa = PBXShellScriptBuildPhase;
248 buildActionMask = 2147483647; 248 buildActionMask = 2147483647;
249 files = ( 249 files = (
250 ); 250 );
251 inputPaths = ( 251 inputPaths = (
252 ); 252 );
253 - name = "Bundle React Native code and images"; 253 + name = "📦 Check Pods Manifest.lock";
254 outputPaths = ( 254 outputPaths = (
255 ); 255 );
256 runOnlyForDeploymentPostprocessing = 0; 256 runOnlyForDeploymentPostprocessing = 0;
257 shellPath = /bin/sh; 257 shellPath = /bin/sh;
258 - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 258 + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
  259 + showEnvVarsInLog = 0;
259 }; 260 };
260 - 1FDAA1517B73CCED81A0B7BF /* Embed Pods Frameworks */ = { 261 + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
261 isa = PBXShellScriptBuildPhase; 262 isa = PBXShellScriptBuildPhase;
262 buildActionMask = 2147483647; 263 buildActionMask = 2147483647;
263 files = ( 264 files = (
264 ); 265 );
265 inputPaths = ( 266 inputPaths = (
266 ); 267 );
267 - name = "Embed Pods Frameworks"; 268 + name = "Bundle React Native code and images";
268 outputPaths = ( 269 outputPaths = (
269 ); 270 );
270 runOnlyForDeploymentPostprocessing = 0; 271 runOnlyForDeploymentPostprocessing = 0;
271 shellPath = /bin/sh; 272 shellPath = /bin/sh;
272 - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor-frameworks.sh\"\n";  
273 - showEnvVarsInLog = 0; 273 + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
274 }; 274 };
275 - B323DDDC1CCFDE05561C14D4 /* Check Pods Manifest.lock */ = { 275 + 406E3ABF16326E848AFE2A52 /* 📦 Copy Pods Resources */ = {
276 isa = PBXShellScriptBuildPhase; 276 isa = PBXShellScriptBuildPhase;
277 buildActionMask = 2147483647; 277 buildActionMask = 2147483647;
278 files = ( 278 files = (
279 ); 279 );
280 inputPaths = ( 280 inputPaths = (
281 ); 281 );
282 - name = "Check Pods Manifest.lock"; 282 + name = "📦 Copy Pods Resources";
283 outputPaths = ( 283 outputPaths = (
284 ); 284 );
285 runOnlyForDeploymentPostprocessing = 0; 285 runOnlyForDeploymentPostprocessing = 0;
286 shellPath = /bin/sh; 286 shellPath = /bin/sh;
287 - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 287 + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor-resources.sh\"\n";
288 showEnvVarsInLog = 0; 288 showEnvVarsInLog = 0;
289 }; 289 };
290 - BF65CB909474B53921DEDF7E /* Copy Pods Resources */ = { 290 + DCCB17D41CAF2C27BC937F1E /* 📦 Embed Pods Frameworks */ = {
291 isa = PBXShellScriptBuildPhase; 291 isa = PBXShellScriptBuildPhase;
292 buildActionMask = 2147483647; 292 buildActionMask = 2147483647;
293 files = ( 293 files = (
294 ); 294 );
295 inputPaths = ( 295 inputPaths = (
296 ); 296 );
297 - name = "Copy Pods Resources"; 297 + name = "📦 Embed Pods Frameworks";
298 outputPaths = ( 298 outputPaths = (
299 ); 299 );
300 runOnlyForDeploymentPostprocessing = 0; 300 runOnlyForDeploymentPostprocessing = 0;
301 shellPath = /bin/sh; 301 shellPath = /bin/sh;
302 - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor-resources.sh\"\n"; 302 + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor-frameworks.sh\"\n";
303 showEnvVarsInLog = 0; 303 showEnvVarsInLog = 0;
304 }; 304 };
305 /* End PBXShellScriptBuildPhase section */ 305 /* End PBXShellScriptBuildPhase section */
@@ -386,7 +386,7 @@ @@ -386,7 +386,7 @@
386 }; 386 };
387 13B07F941A680F5B00A75B9A /* Debug */ = { 387 13B07F941A680F5B00A75B9A /* Debug */ = {
388 isa = XCBuildConfiguration; 388 isa = XCBuildConfiguration;
389 - baseConfigurationReference = E38B39E1C626434D633DF86C /* Pods-YH_Vendor.debug.xcconfig */; 389 + baseConfigurationReference = F573E9D3010460361AD8AE1C /* Pods-YH_Vendor.debug.xcconfig */;
390 buildSettings = { 390 buildSettings = {
391 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 391 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
392 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 392 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
@@ -415,7 +415,7 @@ @@ -415,7 +415,7 @@
415 }; 415 };
416 13B07F951A680F5B00A75B9A /* Release */ = { 416 13B07F951A680F5B00A75B9A /* Release */ = {
417 isa = XCBuildConfiguration; 417 isa = XCBuildConfiguration;
418 - baseConfigurationReference = B44EE6A85A06E0E02E6B1F23 /* Pods-YH_Vendor.release.xcconfig */; 418 + baseConfigurationReference = 32146CF42F1683ED997A873A /* Pods-YH_Vendor.release.xcconfig */;
419 buildSettings = { 419 buildSettings = {
420 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 420 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
421 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 421 ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
@@ -35,7 +35,7 @@ export default class Login extends Component { @@ -35,7 +35,7 @@ export default class Login extends Component {
35 <View style={styles.container}> 35 <View style={styles.container}>
36 <View style={styles.accountContainer }> 36 <View style={styles.accountContainer }>
37 <Text style={styles.text}> 37 <Text style={styles.text}>
38 - 账号:{this.props.username} 38 + 账号:{this.props.account}
39 </Text> 39 </Text>
40 </View> 40 </View>
41 <View style={styles.line}/> 41 <View style={styles.line}/>
1 module.exports = { 1 module.exports = {
2 dev: { 2 dev: {
3 // baseUrl: 'http://testapi.yoho.cn:28077', 3 // baseUrl: 'http://testapi.yoho.cn:28077',
4 - baseUrl: 'http://172.16.6.108:8080/gateway', 4 + baseUrl: 'http://172.16.6.108:8080',
5 privateKey: 'a85bb0674e08986c6b115d5e3a4884fa', 5 privateKey: 'a85bb0674e08986c6b115d5e3a4884fa',
6 httpTimeout: 30000, //毫秒 6 httpTimeout: 30000, //毫秒
7 7
8 }, 8 },
9 prd: { 9 prd: {
10 - baseUrl: 'http://service.yoho.cn', 10 + baseUrl: 'http://172.16.6.108:8080',
11 privateKey: 'a85bb0674e08986c6b115d5e3a4884fa', 11 privateKey: 'a85bb0674e08986c6b115d5e3a4884fa',
12 httpTimeout: 30000, //毫秒 12 httpTimeout: 30000, //毫秒
13 13
@@ -86,9 +86,9 @@ export default class LoginContainer extends Component { @@ -86,9 +86,9 @@ export default class LoginContainer extends Component {
86 onLoginPress() { 86 onLoginPress() {
87 Alert.alert( 87 Alert.alert(
88 '登录', 88 '登录',
89 - this.props.user.profile.account+'+'+this.props.user.profile.pid, 89 + this.props.user.profile.account+'+'+this.props.user.profile.password,
90 [ 90 [
91 - {text: 'OK', onPress: () => this.props.actions.login(this.props.user.profile.account,this.props.user.profile.pid)}, 91 + {text: 'OK', onPress: () => this.props.actions.login(this.props.user.profile.account,this.props.user.profile.password)},
92 ] 92 ]
93 ); 93 );
94 94
@@ -108,7 +108,7 @@ export default class LoginContainer extends Component { @@ -108,7 +108,7 @@ export default class LoginContainer extends Component {
108 onPwdChange={this.onPwdChange} 108 onPwdChange={this.onPwdChange}
109 isFetching={this.props.user.isFetching} 109 isFetching={this.props.user.isFetching}
110 account={this.props.user.profile.account} 110 account={this.props.user.profile.account}
111 - pwd={this.props.user.profile.pid} 111 + pwd={this.props.user.profile.password}
112 isDisplayPwd={this.props.user.isShowPwd}/> 112 isDisplayPwd={this.props.user.isShowPwd}/>
113 113
114 ); 114 );
@@ -86,7 +86,7 @@ export default class LogoutContainer extends Component { @@ -86,7 +86,7 @@ export default class LogoutContainer extends Component {
86 <Logout 86 <Logout
87 account={this.props.user.profile.account} 87 account={this.props.user.profile.account}
88 username={this.props.user.profile.username} 88 username={this.props.user.profile.username}
89 - pwd={this.props.user.profile.pid} 89 + pwd={this.props.user.profile.password}
90 onLogoutPress={this.onLogoutPress} 90 onLogoutPress={this.onLogoutPress}
91 onModifyPress={this.onModifyPress} 91 onModifyPress={this.onModifyPress}
92 /> 92 />
@@ -88,13 +88,23 @@ export default class ModifyPasswordContainer extends Component { @@ -88,13 +88,23 @@ export default class ModifyPasswordContainer extends Component {
88 } 88 }
89 89
90 onModifySubmitPress(){ 90 onModifySubmitPress(){
91 - Alert.alert( 91 + if(this.props.user.password.old===this.props.user.password.new){
  92 + Alert.alert(
  93 + '密码不相同',
  94 + this.props.user.profile.pid+'+'+this.props.user.password.old+'+'+this.props.user.password.new,
  95 + [
  96 +
  97 + ]
  98 + );
  99 + }else{
  100 + Alert.alert(
92 '修改密码', 101 '修改密码',
93 - this.props.user.password.old+'+'+this.props.user.password.new+'+'+this.props.user.password.repeat, 102 + this.props.user.profile.pid+'+'+this.props.user.password.old+'+'+this.props.user.password.new,
94 [ 103 [
95 - {text: 'OK', onPress: () => this.props.actions.pwdModifySubmit()}, 104 + {text: 'OK', onPress: () => this.props.actions.pwdModifySubmit(this.props.user.profile.pid,this.props.user.password.old,this.props.user.password.new)},
96 ] 105 ]
97 ); 106 );
  107 + }
98 } 108 }
99 109
100 render() { 110 render() {
@@ -94,6 +94,7 @@ export function loginRequest() { @@ -94,6 +94,7 @@ export function loginRequest() {
94 } 94 }
95 95
96 export function loginSuccess(json) { 96 export function loginSuccess(json) {
  97 + console.log(json);
97 return { 98 return {
98 type: LOGIN_SUCCESS, 99 type: LOGIN_SUCCESS,
99 payload: json 100 payload: json
@@ -171,8 +172,18 @@ export function pwdModifyRepeat(pwd) { @@ -171,8 +172,18 @@ export function pwdModifyRepeat(pwd) {
171 }; 172 };
172 } 173 }
173 174
174 -export function pwdModifySubmit() {  
175 - 175 +export function pwdModifySubmit(pid, oldPwd,newPwd) {
  176 + return dispatch => {
  177 + // dispatch(loginRequest());
  178 + return new UserService().login(pid,oldPwd,newPwd)
  179 + .then(function (json) {
  180 + dispatch(modifySubmitDone());
  181 + Actions.pop();
  182 + })
  183 + .catch((error) => {
  184 + console.error(error);
  185 + });
  186 + };
176 return { 187 return {
177 type: PWD_MODIFY_SUBMIT 188 type: PWD_MODIFY_SUBMIT
178 }; 189 };
@@ -185,10 +196,10 @@ export function login(account, password) { @@ -185,10 +196,10 @@ export function login(account, password) {
185 return new UserService().login(account,password) 196 return new UserService().login(account,password)
186 .then(function (json) { 197 .then(function (json) {
187 console.log(json); 198 console.log(json);
  199 + dispatch(loginSuccess(json));
  200 + Actions.Drawer();
188 return saveSessionToken(json) 201 return saveSessionToken(json)
189 .then(function () { 202 .then(function () {
190 - dispatch(loginSuccess(json));  
191 - Actions.Drawer();  
192 }); 203 });
193 }) 204 })
194 .catch((error) => { 205 .catch((error) => {
@@ -200,6 +211,12 @@ export function login(account, password) { @@ -200,6 +211,12 @@ export function login(account, password) {
200 211
201 } 212 }
202 213
  214 +export function modifySubmitDone() {
  215 + return {
  216 + type: PWD_MODIFY_SUBMIT
  217 + };
  218 +}
  219 +
203 export function saveSessionToken(json) { 220 export function saveSessionToken(json) {
204 return new AppAuthToken().storeSessionToken(json); 221 return new AppAuthToken().storeSessionToken(json);
205 } 222 }
@@ -26,6 +26,7 @@ let InitialState = Record({ @@ -26,6 +26,7 @@ let InitialState = Record({
26 isShowPwd:false, 26 isShowPwd:false,
27 profile: new (Record({ 27 profile: new (Record({
28 account: '', 28 account: '',
  29 + password:'',
29 pid: '', 30 pid: '',
30 username: '', 31 username: '',
31 sessionKey: '', 32 sessionKey: '',
@@ -70,7 +70,7 @@ export default function userReducer(state = initialState, action) { @@ -70,7 +70,7 @@ export default function userReducer(state = initialState, action) {
70 return nextState; 70 return nextState;
71 } 71 }
72 case PWD_CHANGE:{ 72 case PWD_CHANGE:{
73 - let nextState = state.setIn(['profile', 'pid'], action.payload); 73 + let nextState = state.setIn(['profile', 'password'], action.payload);
74 return nextState; 74 return nextState;
75 } 75 }
76 case PWD_MODIFY_OLD:{ 76 case PWD_MODIFY_OLD:{
@@ -94,6 +94,7 @@ export default function userReducer(state = initialState, action) { @@ -94,6 +94,7 @@ export default function userReducer(state = initialState, action) {
94 case LOGOUT_REQUEST:{ 94 case LOGOUT_REQUEST:{
95 let nextState = state.setIn(['profile', 'pid'], '').setIn(['profile', 'account'], '') 95 let nextState = state.setIn(['profile', 'pid'], '').setIn(['profile', 'account'], '')
96 .setIn(['profile', 'pid'], '') 96 .setIn(['profile', 'pid'], '')
  97 + .setIn(['profile', 'password'], '')
97 .setIn(['profile', 'sessionKey'], ''); 98 .setIn(['profile', 'sessionKey'], '');
98 return nextState; 99 return nextState;
99 } 100 }
@@ -106,16 +107,16 @@ export default function userReducer(state = initialState, action) { @@ -106,16 +107,16 @@ export default function userReducer(state = initialState, action) {
106 } 107 }
107 108
108 case LOGIN_SUCCESS: { 109 case LOGIN_SUCCESS: {
109 - const {account, pid, sessionKey, shops} = action.payload; 110 + console.log('==========6');
  111 + const {account, pid, session_key, shops} = action.payload;
  112 + console.log('==========7');
110 let ShopRecord = Record({ id: '', name: '' }) 113 let ShopRecord = Record({ id: '', name: '' })
111 - let shopsList = Immutable.fromJS(shops, function(key, value) {  
112 - return new ShopRecord(value);  
113 - }); 114 + let shopsList = Immutable.fromJS(shops);
114 let nextState = state.set('isFetching', false) 115 let nextState = state.set('isFetching', false)
115 .set('error', null) 116 .set('error', null)
116 .setIn(['profile', 'account'], account) 117 .setIn(['profile', 'account'], account)
117 .setIn(['profile', 'pid'], pid) 118 .setIn(['profile', 'pid'], pid)
118 - .setIn(['profile', 'sessionKey'], sessionKey) 119 + .setIn(['profile', 'sessionKey'], session_key)
119 .set('shops', shopsList); 120 .set('shops', shopsList);
120 return nextState; 121 return nextState;
121 } 122 }
@@ -9,18 +9,43 @@ export default class UserService { @@ -9,18 +9,43 @@ export default class UserService {
9 } 9 }
10 10
11 async login(account, password) { 11 async login(account, password) {
12 - return this.api.post({  
13 - url: '/gateway?method=app.passport.signin', 12 + return this.api.get({
  13 + url: '/gateway',
14 body: { 14 body: {
15 account: account, 15 account: account,
16 password: password, 16 password: password,
  17 + method:'app.shops.login',
  18 + debug:'XYZ',
17 } 19 }
18 }) 20 })
19 .then(data => { 21 .then(data => {
20 console.log(data); 22 console.log(data);
  23 + return data;
21 }) 24 })
22 .catch(error => { 25 .catch(error => {
23 console.error(error); 26 console.error(error);
  27 + throw error;
24 }); 28 });
25 } 29 }
  30 +
  31 + async modifyPassword(pid, oldPwd,newPwd) {
  32 + return this.api.get({
  33 + url: '/gateway',
  34 + body: {
  35 + pid: pid,
  36 + oldPwd: oldPwd,
  37 + newPwd:newPwd,
  38 + method:'app.shops.changePwd',
  39 + debug:'XYZ',
  40 + }
  41 + })
  42 + .then(data => {
  43 + console.log(data);
  44 + return data;
  45 + })
  46 + .catch(error => {
  47 + console.error(error);
  48 + throw error;
  49 + });
  50 + }
26 } 51 }