Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
M
manager-app-sz
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
ReactNative
manager-app-sz
Commits
6a09b896
提交
6a09b896
authored
1月 18, 2019
作者:
吴强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
对某些依赖等进行了升级
上级
0d9e986a
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
190 行增加
和
181 行删除
+190
-181
build.gradle
android/app/build.gradle
+1
-1
AndroidManifest.xml
android/app/src/main/AndroidManifest.xml
+44
-37
build.gradle
android/build.gradle
+33
-32
gradle-wrapper.properties
android/gradle/wrapper/gradle-wrapper.properties
+6
-5
package-lock.json
package-lock.json
+0
-0
http-helper.js
src/utils/http-helper.js
+106
-106
没有找到文件。
android/app/build.gradle
浏览文件 @
6a09b896
...
@@ -170,7 +170,7 @@ dependencies {
...
@@ -170,7 +170,7 @@ dependencies {
compile
project
(
':react-native-code-push'
)
compile
project
(
':react-native-code-push'
)
compile
project
(
':react-native-device-info'
)
compile
project
(
':react-native-device-info'
)
compile
fileTree
(
dir:
"libs"
,
include:
[
"*.jar"
])
compile
fileTree
(
dir:
"libs"
,
include:
[
"*.jar"
])
compile
"com.android.support:appcompat-v7:25.4.0"
compile
'com.android.support:appcompat-v7:25.4.0'
compile
'com.android.support:multidex:1.0.1'
compile
'com.android.support:multidex:1.0.1'
compile
"com.facebook.react:react-native:+"
// From node_modules
compile
"com.facebook.react:react-native:+"
// From node_modules
compile
project
(
':react-native-vector-icons'
)
// 2017-10-31 wq add
compile
project
(
':react-native-vector-icons'
)
// 2017-10-31 wq add
...
...
android/app/src/main/AndroidManifest.xml
浏览文件 @
6a09b896
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.bolanmanagerapp"
xmlns:tools =
"http://schemas.android.com/tools"
android:versionCode=
"1"
package=
"com.bolanmanagerapp"
android:versionName=
"1.0"
>
android:versionCode=
"1"
android:versionName=
"1.0"
<uses-permission
android:name=
"android.permission.INTERNET"
/>
>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH"
/>
<uses-permission
android:name=
"android.permission.RECORD_AUDIO"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.RECORD_AUDIO"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-sdk
android:minSdkVersion=
"16"
<uses-sdk
android:targetSdkVersion=
"22"
/>
android:targetSdkVersion=
"22"
/>
<application
<application
android:name=
".MainApplication"
android:name=
".MainApplication"
android:allowBackup=
"true"
android:allowBackup=
"true"
android:label=
"@string/app_name"
android:label=
"@string/app_name"
android:icon=
"@mipmap/ic_launcher"
android:icon=
"@mipmap/ic_launcher"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
<activity
>
android:name=
".MainActivity"
<meta-data
android:label=
"@string/app_name"
tools:replace=
"android:value"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:name=
"android.support.VERSION"
android:windowSoftInputMode=
"adjustResize"
>
android:value=
"26.1.0"
/>
<intent-filter>
<activity
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
android:name=
".MainActivity"
</intent-filter>
</activity>
android:label=
"@string/app_name"
<activity
android:name=
"com.facebook.react.devsupport.DevSettingsActivity"
/>
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
</application>
android:windowSoftInputMode=
"adjustResize"
>
<intent-filter>
</manifest>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
"com.facebook.react.devsupport.DevSettingsActivity"
/>
</application>
</manifest>
android/build.gradle
浏览文件 @
6a09b896
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
buildscript
{
repositories
{
repositories
{
jcenter
()
jcenter
()
maven
{
maven
{
url
'https://maven.google.com/'
url
'https://maven.google.com/'
name
'Google'
name
'Google'
}
}
}
google
()
dependencies
{
}
classpath
'com.android.tools.build:gradle:2.3.3'
dependencies
{
classpath
'com.android.tools.build:gradle:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// NOTE: Do not place your application dependencies here; they belong
}
// in the individual module build.gradle files
}
}
}
allprojects
{
repositories
{
allprojects
{
mavenLocal
()
repositories
{
jcenter
()
mavenLocal
()
maven
{
jcenter
()
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
maven
{
url
"$rootDir/../node_modules/react-native/android"
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
}
url
"$rootDir/../node_modules/react-native/android"
maven
{
}
url
'https://maven.google.com/'
maven
{
name
'Google'
url
'https://maven.google.com/'
}
name
'Google'
}
}
}
}
}
android/gradle/wrapper/gradle-wrapper.properties
浏览文件 @
6a09b896
distributionBase
=
GRADLE_USER_HOME
#Fri Jan 18 11:39:12 CST 2019
distributionPath
=
wrapper/dists
distributionBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
zipStorePath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-3.3-all.zip
zipStorePath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.10.1-all.zip
package-lock.json
浏览文件 @
6a09b896
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/utils/http-helper.js
浏览文件 @
6a09b896
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
{
Resolver
}
from
'fastjson_ref_resolver'
;
import
{
Resolver
}
from
'fastjson_ref_resolver'
;
/**
/**
* @global
* @global
* @typedef {Object} RestResponse
* @typedef {Object} RestResponse
* @template T
* @template T
* @property {number} errorCode 错误码,0表示成功
* @property {number} errorCode 错误码,0表示成功
* @property {T} data 数据
* @property {T} data 数据
*/
*/
export
function
checkStatus
(
response
)
{
export
function
checkStatus
(
response
)
{
if
(
response
.
status
>=
200
&&
response
.
status
<
300
)
{
if
(
response
.
status
>=
200
&&
response
.
status
<
300
)
{
return
response
;
return
response
;
}
}
return
response
.
json
().
then
((
data
)
=>
{
return
response
.
json
().
then
((
data
)
=>
{
const
error
=
new
Error
(
data
.
message
?
data
.
message
:
response
.
statusText
);
const
error
=
new
Error
(
data
.
message
?
data
.
message
:
response
.
statusText
);
error
.
data
=
data
;
error
.
data
=
data
;
throw
error
;
throw
error
;
});
});
}
}
export
function
normParams
(
unnormed
)
{
export
function
normParams
(
unnormed
)
{
if
(
_
.
isPlainObject
(
unnormed
))
{
if
(
_
.
isPlainObject
(
unnormed
))
{
return
_
(
unnormed
).
toPairs
().
flatMap
(([
k
,
v
])
=>
(
_
.
isArray
(
v
)
?
v
.
map
(
vv
=>
[
k
,
vv
])
:
[[
k
,
v
]])).
value
();
return
_
(
unnormed
).
toPairs
().
flatMap
(([
k
,
v
])
=>
(
_
.
isArray
(
v
)
?
v
.
map
(
vv
=>
[
k
,
vv
])
:
[[
k
,
v
]])).
value
();
}
else
{
}
else
{
return
unnormed
;
return
unnormed
;
}
}
}
}
// eslint-disable-next-line max-len
// eslint-disable-next-line max-len
export
function
parseObject
(
response
,
{
export
function
parseObject
(
response
,
{
num2str
=
false
,
bool2str
=
false
,
nul2str
=
false
,
ud2str
=
false
,
nil2str
=
false
,
num2str
=
false
,
bool2str
=
false
,
nul2str
=
false
,
ud2str
=
false
,
nil2str
=
false
,
}
=
{})
{
}
=
{})
{
if
(
response
.
status
===
204
)
{
// no-content
if
(
response
.
status
===
204
)
{
// no-content
return
null
;
return
null
;
}
else
{
}
else
{
const
contentType
=
response
.
headers
.
get
(
'content-type'
);
const
contentType
=
response
.
headers
.
get
(
'content-type'
);
if
(
contentType
)
{
if
(
contentType
)
{
const
needMap
=
num2str
||
bool2str
||
nul2str
||
ud2str
||
nil2str
;
const
needMap
=
num2str
||
bool2str
||
nul2str
||
ud2str
||
nil2str
;
const
mapStr
=
(
value
)
=>
{
const
mapStr
=
(
value
)
=>
{
if
(
num2str
&&
_
.
isNumber
(
value
))
{
if
(
num2str
&&
_
.
isNumber
(
value
))
{
return
value
.
toString
();
return
value
.
toString
();
}
}
if
(
bool2str
&&
_
.
isBoolean
(
value
))
{
if
(
bool2str
&&
_
.
isBoolean
(
value
))
{
return
value
.
toString
();
return
value
.
toString
();
}
}
if
(
nul2str
&&
_
.
isNull
(
value
))
{
if
(
nul2str
&&
_
.
isNull
(
value
))
{
return
''
;
return
''
;
}
}
if
(
ud2str
&&
_
.
isUndefined
(
value
))
{
if
(
ud2str
&&
_
.
isUndefined
(
value
))
{
return
''
;
return
''
;
}
}
if
(
nil2str
&&
_
.
isNil
(
value
))
{
if
(
nil2str
&&
_
.
isNil
(
value
))
{
return
''
;
return
''
;
}
}
return
value
;
return
value
;
};
};
const
mapObj
=
(
obj
,
mapArrFunc
)
=>
{
const
mapObj
=
(
obj
,
mapArrFunc
)
=>
{
if
(
_
.
isArray
(
obj
))
{
if
(
_
.
isArray
(
obj
))
{
return
mapArrFunc
(
obj
,
mapObj
);
return
mapArrFunc
(
obj
,
mapObj
);
}
}
if
(
_
.
isPlainObject
(
obj
))
{
if
(
_
.
isPlainObject
(
obj
))
{
return
_
.
mapValues
(
obj
,
(
val
)
=>
{
return
_
.
mapValues
(
obj
,
(
val
)
=>
{
const
ret
=
mapStr
(
val
);
const
ret
=
mapStr
(
val
);
return
mapObj
(
ret
,
mapArrFunc
);
return
mapObj
(
ret
,
mapArrFunc
);
});
});
}
}
return
obj
;
return
obj
;
};
};
const
mapArr
=
(
arr
,
mapObjFunc
)
=>
{
const
mapArr
=
(
arr
,
mapObjFunc
)
=>
{
if
(
_
.
isPlainObject
(
arr
))
{
if
(
_
.
isPlainObject
(
arr
))
{
return
mapObjFunc
(
arr
,
mapArr
);
return
mapObjFunc
(
arr
,
mapArr
);
}
}
if
(
_
.
isArray
(
arr
))
{
if
(
_
.
isArray
(
arr
))
{
return
_
.
map
(
arr
,
(
val
)
=>
{
return
_
.
map
(
arr
,
(
val
)
=>
{
const
ret
=
mapStr
(
val
);
const
ret
=
mapStr
(
val
);
return
mapArr
(
ret
,
mapObjFunc
);
return
mapArr
(
ret
,
mapObjFunc
);
});
});
}
}
return
arr
;
return
arr
;
};
};
const
mapValue
=
_
.
curry
(
mapObj
)(
_
,
mapArr
);
const
mapValue
=
_
.
curry
(
mapObj
)(
_
,
mapArr
);
if
(
contentType
.
indexOf
(
'json'
)
!==
-
1
)
{
if
(
contentType
.
indexOf
(
'json'
)
!==
-
1
)
{
return
response
.
json
()
return
response
.
json
()
.
then
((
json
)
=>
{
.
then
((
json
)
=>
{
if
(
json
.
errorCode
===
0
)
{
if
(
json
.
errorCode
===
0
)
{
let
{
data
}
=
json
;
if
(
_
.
isObjectLike
(
json
))
{
if
(
_
.
isObjectLike
(
data
))
{
json
=
new
Resolver
(
json
).
resolve
();
data
=
new
Resolver
(
json
.
data
).
resolve
();
}
}
const
{
data
}
=
json
;
return
needMap
?
mapValue
(
data
)
:
data
;
return
needMap
?
mapValue
(
data
)
:
data
;
}
else
{
}
else
{
throw
new
Error
(
json
.
message
);
throw
new
Error
(
json
.
message
);
}
}
});
});
}
else
if
(
contentType
.
indexOf
(
'text'
)
!==
-
1
)
{
}
else
if
(
contentType
.
indexOf
(
'text'
)
!==
-
1
)
{
return
response
.
text
();
return
response
.
text
();
}
else
{
}
else
{
throw
new
Error
(
`Unsupported response content type:
${
contentType
}
`
);
throw
new
Error
(
`Unsupported response content type:
${
contentType
}
`
);
}
}
}
else
{
}
else
{
throw
new
Error
(
'No response content type.'
);
throw
new
Error
(
'No response content type.'
);
}
}
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论