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
9265037c
authored
Mar 28, 2021
by
wong.peiyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
只安装的时候设置一次域名地址
parent
bba2421e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
app/action/LoginAction.js
app/base/ActionTypes.js
app/containers/login/LoginPage.js
app/reducers/module/login.js
app/action/LoginAction.js
View file @
9265037c
...
...
@@ -6,7 +6,8 @@ import {
AUTO_LOGIN_SUCCESS
,
AUTO_LOGIN_FAILURE
,
SET_DOMAIN_CONFIGURATE
,
SET_VERSION_APK
SET_VERSION_APK
,
SET_DOMAIN_FROM_ORIGIN
}
from
'../base/ActionTypes'
;
import
{
GetRequest
,
PostRequest
}
from
'../network/RequestUtils'
;
import
{
getUrlParams
,
show
,
showWarnErrorMessage
,
showErrorMessage
}
from
'../utils/Utils'
;
...
...
@@ -116,6 +117,13 @@ export function setDomainConfigurate(domainVal) {
}
}
export
function
setDomainFromOrigin
(
hasSet
)
{
return
{
type
:
SET_DOMAIN_FROM_ORIGIN
,
data
:
hasSet
}
}
//系统配置文件查询接口 access_token profile_code
export
const
requestSysProfile
=
async
(
global_domain_config
,
params
)
=>
{
return
await
GetRequest
(
global_domain_config
,
getUrlParams
(
'/system/sys_profile/search'
,
params
))
...
...
app/base/ActionTypes.js
View file @
9265037c
...
...
@@ -7,6 +7,7 @@ export const EXIT_LOGIN = "EXIT_LOGIN"
export
const
AUTO_LOGIN_SUCCESS
=
"AUTO_LOGIN_SUCCESS"
export
const
AUTO_LOGIN_FAILURE
=
"AUTO_LOGIN_FAILURE"
export
const
SET_DOMAIN_CONFIGURATE
=
"SET_DOMAIN_CONFIGURATE"
export
const
SET_DOMAIN_FROM_ORIGIN
=
'SET_DOMAIN_FROM_ORIGIN'
export
const
SET_VERSION_APK
=
"SET_VERSION_APK"
//-----------self order---------------------
export
const
SELF_ORDER_LIST_NO
=
"SELF_ORDER_LIST_NO"
...
...
app/containers/login/LoginPage.js
View file @
9265037c
...
...
@@ -28,7 +28,7 @@ import {
safe_view
,
font_family_medium
}
from
'../../base/BaseStyle'
;
import
{
requestLogin
,
autoLogin
,
setDomainConfigurate
,
setVersionApk
}
from
'../../action/LoginAction'
;
import
{
requestLogin
,
autoLogin
,
setDomainConfigurate
,
setVersionApk
,
setDomainFromOrigin
}
from
'../../action/LoginAction'
;
import
{
show
,
isEmpty
}
from
'../../utils/Utils'
;
import
{
LOGIN_DOING
,
LOGIN_SUCCESS
,
LOGIN_FAILURE
,
LOGIN_NO
}
from
'../../base/ActionTypes'
;
import
StatusBarView
from
'../common/StatusBarView'
;
...
...
@@ -67,7 +67,10 @@ class LoginPage extends Component{
async
setDefaultDomain
()
{
try
{
const
baseUrl
=
await
NativeModules
.
RNToolsManager
.
getBaseUrl
()
if
(
baseUrl
&&
!
this
.
props
.
hasSet
)
{
this
.
props
.
setDomainConfigurate
(
baseUrl
)
this
.
props
.
setDomainFromOrigin
(
true
)
}
}
catch
(
error
)
{
console
.
log
(
'do not suppor getBaseUrl'
)
}
...
...
@@ -507,7 +510,8 @@ const mapStateToProps = (state) => ({
loginState
:
state
.
login
.
loginState
,
username
:
state
.
login
.
username
,
password
:
state
.
login
.
password
,
global_domain_config
:
state
.
login
.
global_domain_config
global_domain_config
:
state
.
login
.
global_domain_config
,
hasSet
:
state
.
login
.
hasSetDomainFromOrigin
})
const
mapDispatchToProps
=
(
dispatch
)
=>
({
...
...
@@ -523,6 +527,9 @@ const mapDispatchToProps = (dispatch) => ({
setVersionApk
:
(
versionApk
)
=>
{
dispatch
(
setVersionApk
(
versionApk
))
},
setDomainFromOrigin
:
(
hasSet
)
=>
{
dispatch
(
setDomainFromOrigin
(
hasSet
))
}
})
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
LoginPage
)
app/reducers/module/login.js
View file @
9265037c
...
...
@@ -7,7 +7,8 @@ import {
AUTO_LOGIN_SUCCESS
,
AUTO_LOGIN_FAILURE
,
SET_DOMAIN_CONFIGURATE
,
SET_VERSION_APK
SET_VERSION_APK
,
SET_DOMAIN_FROM_ORIGIN
}
from
'../../base/ActionTypes'
;
// 登录状态
...
...
@@ -18,6 +19,7 @@ const defaultState = {
username
:
''
,
password
:
''
,
global_domain_config
:
'https://obs.uat.guke.tech'
,
hasSetDomainFromOrigin
:
false
,
local_version_apk
:
''
,
// 默认【深圳仓】https://obs.uat.guke.tech;【十方uat】https://obs.uat.sfrx.guke.tech;【十方pro】https://obs.sfrx.orth.tech
// 【国药dev】https://obs.dev.guke.tech;【国药pro】https://obs-pro.gyjtsx.com
...
...
@@ -63,6 +65,10 @@ export default login = (state = defaultState, action) => {
return
Object
.
assign
({},
state
,
{
global_domain_config
:
action
.
global_domain_config
})
case
SET_DOMAIN_FROM_ORIGIN
:
return
Object
.
assign
({},
state
,
{
hasSetDomainFromOrigin
:
action
.
data
})
case
SET_VERSION_APK
:
return
Object
.
assign
({},
state
,
{
local_version_apk
:
action
.
local_version_apk
...
...
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