Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhu_wap_bridge
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
千变科技开源组件
zhu_wap_bridge
Commits
9fbbb9c8
Commit
9fbbb9c8
authored
Mar 13, 2021
by
王远浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增-新增用户功能
parent
f915efc8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
135 additions
and
8 deletions
+135
-8
.umirc.js
.umirc.js
+1
-0
_Bridge.js
components/_Bridge.js
+12
-0
_Bridge.js
lib/_Bridge.js
+68
-1
addUser.js
pages/addUser.js
+45
-0
index.js
pages/index.js
+4
-0
yarn.lock
yarn.lock
+5
-7
No files found.
.umirc.js
View file @
9fbbb9c8
...
@@ -33,5 +33,6 @@ export default {
...
@@ -33,5 +33,6 @@ export default {
{
path
:
'/dialog'
,
component
:
'../pages/dialog'
},
{
path
:
'/dialog'
,
component
:
'../pages/dialog'
},
{
path
:
'/baiduAI'
,
component
:
'../pages/baiduAI'
},
{
path
:
'/baiduAI'
,
component
:
'../pages/baiduAI'
},
{
path
:
'/openScreen'
,
component
:
'../pages/openScreen'
},
{
path
:
'/openScreen'
,
component
:
'../pages/openScreen'
},
{
path
:
'/addUser'
,
component
:
'../pages/addUser'
},
]
]
}
}
components/_Bridge.js
View file @
9fbbb9c8
...
@@ -457,6 +457,17 @@ export const takeIdCardAndDiscern = async (opt) => {
...
@@ -457,6 +457,17 @@ export const takeIdCardAndDiscern = async (opt) => {
})
})
};
};
/**
* @name addAppUser 新增用户
* @param appId 子应用Id
*/
export
const
addAppUser
=
async
(
appId
)
=>
{
return
new
Promise
(
async
(
resolve
)
=>
{
invoke
.
define
(
'addAppUserCompleted'
,
async
(
result
)
=>
{
resolve
(
result
)});
await
invoke
.
bind
(
"addAppUser"
)(
appId
)
})
};
export
const
EVENTS_TYPE
=
{
export
const
EVENTS_TYPE
=
{
keyboardWillShow
:
'keyboardWillShow'
,
// 键盘即将出现
keyboardWillShow
:
'keyboardWillShow'
,
// 键盘即将出现
keyboardDidShow
:
'keyboardDidShow'
,
// 键盘已经出现
keyboardDidShow
:
'keyboardDidShow'
,
// 键盘已经出现
...
@@ -500,6 +511,7 @@ export default {
...
@@ -500,6 +511,7 @@ export default {
discernIdCardFront
,
discernIdCardFront
,
discernIdCardBack
,
discernIdCardBack
,
takeIdCardAndDiscern
,
takeIdCardAndDiscern
,
addAppUser
}
}
lib/_Bridge.js
View file @
9fbbb9c8
...
@@ -1948,6 +1948,71 @@ export var takeIdCardAndDiscern = /*#__PURE__*/function () {
...
@@ -1948,6 +1948,71 @@ export var takeIdCardAndDiscern = /*#__PURE__*/function () {
return
_ref81
.
apply
(
this
,
arguments
);
return
_ref81
.
apply
(
this
,
arguments
);
};
};
}();
}();
/**
* @name addAppUser 新增用户
* @param appId 子应用Id
*/
export
var
addAppUser
=
/*#__PURE__*/
function
()
{
var
_ref84
=
_asyncToGenerator
(
/*#__PURE__*/
_regeneratorRuntime
.
mark
(
function
_callee86
(
appId
)
{
return
_regeneratorRuntime
.
wrap
(
function
_callee86$
(
_context86
)
{
while
(
1
)
{
switch
(
_context86
.
prev
=
_context86
.
next
)
{
case
0
:
return
_context86
.
abrupt
(
"return"
,
new
Promise
(
/*#__PURE__*/
function
()
{
var
_ref85
=
_asyncToGenerator
(
/*#__PURE__*/
_regeneratorRuntime
.
mark
(
function
_callee85
(
resolve
)
{
return
_regeneratorRuntime
.
wrap
(
function
_callee85$
(
_context85
)
{
while
(
1
)
{
switch
(
_context85
.
prev
=
_context85
.
next
)
{
case
0
:
invoke
.
define
(
'addAppUserCompleted'
,
/*#__PURE__*/
function
()
{
var
_ref86
=
_asyncToGenerator
(
/*#__PURE__*/
_regeneratorRuntime
.
mark
(
function
_callee84
(
result
)
{
return
_regeneratorRuntime
.
wrap
(
function
_callee84$
(
_context84
)
{
while
(
1
)
{
switch
(
_context84
.
prev
=
_context84
.
next
)
{
case
0
:
resolve
(
result
);
case
1
:
case
"end"
:
return
_context84
.
stop
();
}
}
},
_callee84
);
}));
return
function
(
_x84
)
{
return
_ref86
.
apply
(
this
,
arguments
);
};
}());
_context85
.
next
=
3
;
return
invoke
.
bind
(
"addAppUser"
)(
appId
);
case
3
:
case
"end"
:
return
_context85
.
stop
();
}
}
},
_callee85
);
}));
return
function
(
_x83
)
{
return
_ref85
.
apply
(
this
,
arguments
);
};
}()));
case
1
:
case
"end"
:
return
_context86
.
stop
();
}
}
},
_callee86
);
}));
return
function
addAppUser
(
_x82
)
{
return
_ref84
.
apply
(
this
,
arguments
);
};
}();
export
var
EVENTS_TYPE
=
{
export
var
EVENTS_TYPE
=
{
keyboardWillShow
:
'keyboardWillShow'
,
keyboardWillShow
:
'keyboardWillShow'
,
// 键盘即将出现
// 键盘即将出现
...
@@ -1992,5 +2057,6 @@ export default {
...
@@ -1992,5 +2057,6 @@ export default {
scanBusinessLicense
:
scanBusinessLicense
,
scanBusinessLicense
:
scanBusinessLicense
,
discernIdCardFront
:
discernIdCardFront
,
discernIdCardFront
:
discernIdCardFront
,
discernIdCardBack
:
discernIdCardBack
,
discernIdCardBack
:
discernIdCardBack
,
takeIdCardAndDiscern
:
takeIdCardAndDiscern
takeIdCardAndDiscern
:
takeIdCardAndDiscern
,
addAppUser
:
addAppUser
};
};
\ No newline at end of file
pages/addUser.js
0 → 100644
View file @
9fbbb9c8
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
_Bridge
}
from
'../components'
;
import
{
Button
,
Modal
,
Toast
}
from
"antd-mobile"
;
const
addUser
=
()
=>
{
const
[
result
,
setResult
]
=
useState
();
const
doFunc
=
async
()
=>
{
try
{
setResult
(
null
);
const
result
=
await
_Bridge
.
addAppUser
(
'b2c98c34-ad79-4f1c-b8ec-030f19635193'
);
setResult
(
result
);
}
catch
(
error
)
{
console
.
error
(
error
);
}
};
return
(
<
div
>
<
h1
style
=
{{
textAlign
:
"center"
}}
>
添加用户
<
/h1
>
<
div
style
=
{{
padding
:
20
}}
>
<
Button
style
=
{{
marginBottom
:
20
}}
onClick
=
{
async
()
=>
{
await
doFunc
();
}}
>
添加用户
<
/Button
>
{
result
?
(
<
React
.
Fragment
>
<
p
>
返回结果
<
/p
>
<
p
>
{
JSON
.
stringify
(
result
)}
<
/p
>
<
/React.Fragment
>
)
:
(
<
p
>
空
<
/p
>
)
}
<
/div
>
<
/div
>
);
};
export
default
addUser
;
\ No newline at end of file
pages/index.js
View file @
9fbbb9c8
...
@@ -68,6 +68,10 @@ export default class extends React.Component {
...
@@ -68,6 +68,10 @@ export default class extends React.Component {
<
Button
style
=
{{
marginBottom
:
20
}}
>
获取
Token
<
/Button
>
<
Button
style
=
{{
marginBottom
:
20
}}
>
获取
Token
<
/Button
>
<
/Link
>
<
/Link
>
<
Link
to
=
{
`/addUser`
}
>
<
Button
style
=
{{
marginBottom
:
20
}}
>
新增用户
<
/Button
>
<
/Link
>
<
Button
<
Button
style
=
{{
marginBottom
:
20
}}
style
=
{{
marginBottom
:
20
}}
onClick
=
{
async
()
=>
{
onClick
=
{
async
()
=>
{
...
...
yarn.lock
View file @
9fbbb9c8
...
@@ -4301,11 +4301,6 @@ core-js@2.6.9:
...
@@ -4301,11 +4301,6 @@ core-js@2.6.9:
resolved "https://registry.npm.taobao.org/core-js/download/core-js-2.6.9.tgz?cache=0&sync_timestamp=1609681993371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2"
resolved "https://registry.npm.taobao.org/core-js/download/core-js-2.6.9.tgz?cache=0&sync_timestamp=1609681993371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-2.6.9.tgz#6b4b214620c834152e179323727fc19741b084f2"
integrity sha1-a0shRiDINBUuF5Mjcn/Bl0GwhPI=
integrity sha1-a0shRiDINBUuF5Mjcn/Bl0GwhPI=
core-js@3:
version "3.8.3"
resolved "https://registry.npm.taobao.org/core-js/download/core-js-3.8.3.tgz?cache=0&sync_timestamp=1611038912958&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-3.8.3.tgz#c21906e1f14f3689f93abcc6e26883550dd92dd0"
integrity sha1-whkG4fFPNon5OrzG4miDVQ3ZLdA=
core-js@3.1.4:
core-js@3.1.4:
version "3.1.4"
version "3.1.4"
resolved "https://registry.npm.taobao.org/core-js/download/core-js-3.1.4.tgz?cache=0&sync_timestamp=1609681993371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-3.1.4.tgz#3a2837fc48e582e1ae25907afcd6cf03b0cc7a07"
resolved "https://registry.npm.taobao.org/core-js/download/core-js-3.1.4.tgz?cache=0&sync_timestamp=1609681993371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-3.1.4.tgz#3a2837fc48e582e1ae25907afcd6cf03b0cc7a07"
...
@@ -4326,6 +4321,11 @@ core-js@^3.0.0, core-js@^3.6.5:
...
@@ -4326,6 +4321,11 @@ core-js@^3.0.0, core-js@^3.6.5:
resolved "https://registry.npm.taobao.org/core-js/download/core-js-3.8.2.tgz?cache=0&sync_timestamp=1609681993371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-3.8.2.tgz#0a1fd6709246da9ca8eff5bb0cbd15fba9ac7044"
resolved "https://registry.npm.taobao.org/core-js/download/core-js-3.8.2.tgz?cache=0&sync_timestamp=1609681993371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-3.8.2.tgz#0a1fd6709246da9ca8eff5bb0cbd15fba9ac7044"
integrity sha1-Ch/WcJJG2pyo7/W7DL0V+6mscEQ=
integrity sha1-Ch/WcJJG2pyo7/W7DL0V+6mscEQ=
core-js@^3.8.3:
version "3.9.1"
resolved "https://registry.npm.taobao.org/core-js/download/core-js-3.9.1.tgz?cache=0&sync_timestamp=1614538798750&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcore-js%2Fdownload%2Fcore-js-3.9.1.tgz#cec8de593db8eb2a85ffb0dbdeb312cb6e5460ae"
integrity sha1-zsjeWT246yqF/7Db3rMSy25UYK4=
core-util-is@1.0.2, core-util-is@~1.0.0:
core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
version "1.0.2"
resolved "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
resolved "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
...
@@ -16695,10 +16695,8 @@ watchpack@^1.6.0:
...
@@ -16695,10 +16695,8 @@ watchpack@^1.6.0:
resolved "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.5.tgz?cache=0&sync_timestamp=1607687507945&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwatchpack%2Fdownload%2Fwatchpack-1.7.5.tgz#1267e6c55e0b9b5be44c2023aed5437a2c26c453"
resolved "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.5.tgz?cache=0&sync_timestamp=1607687507945&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwatchpack%2Fdownload%2Fwatchpack-1.7.5.tgz#1267e6c55e0b9b5be44c2023aed5437a2c26c453"
integrity sha1-EmfmxV4Lm1vkTCAjrtVDeiwmxFM=
integrity sha1-EmfmxV4Lm1vkTCAjrtVDeiwmxFM=
dependencies:
dependencies:
chokidar "^3.4.1"
graceful-fs "^4.1.2"
graceful-fs "^4.1.2"
neo-async "^2.5.0"
neo-async "^2.5.0"
watchpack-chokidar2 "^2.0.1"
optionalDependencies:
optionalDependencies:
chokidar "^3.4.1"
chokidar "^3.4.1"
watchpack-chokidar2 "^2.0.1"
watchpack-chokidar2 "^2.0.1"
...
...
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