Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
zhangzhonghua
/
BoneHouse_Business_APP
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7c031b4e
authored
Mar 24, 2021
by
wong.peiyi
1
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
android加上打包渠道
parent
d897b6d0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
6 deletions
android/app/build.gradle
android/app/src/main/assets/index.android.bundle
android/app/src/main/java/com/bonehouse_business_app/RNToolsManager.java
android/app/src/main/res/drawable-mdpi/app_images_eye.png
app/containers/login/LoginPage.js
android/app/build.gradle
View file @
7c031b4e
...
...
@@ -120,6 +120,7 @@ android {
versionName
appVersion
missingDimensionStrategy
'react-native-camera'
,
'general'
multiDexEnabled
true
flavorDimensions
"versionCode"
}
splits
{
abi
{
...
...
@@ -146,6 +147,16 @@ android {
matchingFallbacks
=
[
'release'
]
}
}
productFlavors
{
sz
{
resValue
"string"
,
"baseUrl"
,
'"https://obs.uat.guke.tech"'
}
xhk
{
resValue
"string"
,
"baseUrl"
,
'"https://obs.xhk.orth.tech"'
}
}
// applicationVariants are e.g. debug, release
applicationVariants
.
all
{
variant
->
variant
.
outputs
.
each
{
output
->
...
...
android/app/src/main/assets/index.android.bundle
View file @
7c031b4e
This diff could not be displayed because it is too large.
android/app/src/main/java/com/bonehouse_business_app/RNToolsManager.java
View file @
7c031b4e
...
...
@@ -76,10 +76,10 @@ public class RNToolsManager extends ReactContextBaseJavaModule {
}
}
//
// 声明的设置域名方法,外界调用
//
@ReactMethod
//
public void getBaseUrl(Promise promise) {
// String STRING_API_ENV = getReactApplicationContext().getResources().getString(R.string.strKey
); // 需要在 android/app/build.gradle 添加'productFlavors'
//
promise.resolve(STRING_API_ENV);
//
}
// 声明的设置域名方法,外界调用
@ReactMethod
public
void
getBaseUrl
(
Promise
promise
)
{
String
STRING_API_ENV
=
getReactApplicationContext
().
getResources
().
getString
(
R
.
string
.
baseUrl
);
// 需要在 android/app/build.gradle 添加'productFlavors'
promise
.
resolve
(
STRING_API_ENV
);
}
}
\ No newline at end of file
android/app/src/main/res/drawable-mdpi/app_images_eye.png
0 → 100644
View file @
7c031b4e
4.4 KB
app/containers/login/LoginPage.js
View file @
7c031b4e
...
...
@@ -57,12 +57,22 @@ class LoginPage extends Component{
componentDidMount
()
{
SplashScreen
.
hide
()
//关闭启动屏幕
this
.
timer
=
setTimeout
(()
=>
{
this
.
setDefaultDomain
()
this
.
getLocalUserName
()
this
.
setVersion
()
this
.
initLoginInfo
()
},
300
)
}
async
setDefaultDomain
()
{
try
{
const
baseUrl
=
await
NativeModules
.
RNToolsManager
.
getBaseUrl
()
this
.
props
.
setDomainConfigurate
(
baseUrl
)
}
catch
(
error
)
{
console
.
log
(
'do not suppor getBaseUrl'
)
}
}
componentWillUnmount
()
{
clearTimeout
(
this
.
timer
)
}
...
...
wong.peiyi
@fomalhaut
mentioned in commit
e2e7bd48
Apr 13, 2021
mentioned in commit
e2e7bd48
mentioned in commit e2e7bd480ce42550efca196c20e043cbf4235658
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment