Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
59bc8604
Commit
59bc8604
authored
Jun 09, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:mac企微录音调试
parent
e95833a7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
28 deletions
+7
-28
src/common/js/wechatApi.js
+6
-13
src/modules/teach-tool/components/XMRecord.jsx
+1
-15
No files found.
src/common/js/wechatApi.js
View file @
59bc8604
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Author: wufan
* @Date: 2021-05-11 10:21:37
* @Date: 2021-05-11 10:21:37
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-06-09 19:
25:22
* @LastEditTime: 2021-06-09 19:
45:43
* @Description: 企业微信api
* @Description: 企业微信api
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -20,17 +20,16 @@ export default class WechatApi {
...
@@ -20,17 +20,16 @@ export default class WechatApi {
const
res
=
result
.
result
;
const
res
=
result
.
result
;
this
.
config
({
this
.
config
({
beta
:
true
,
// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
beta
:
true
,
// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug
:
tru
e
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
debug
:
fals
e
,
// 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId
:
res
.
appId
,
// 必填,企业微信的corpID
appId
:
res
.
appId
,
// 必填,企业微信的corpID
timestamp
:
res
.
timestamp
,
// 必填,生成签名的时间戳
timestamp
:
res
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
res
.
nonceStr
,
// 必填,生成签名的随机串
nonceStr
:
res
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
res
.
signature
,
// 必填,签名,见 附录-JS-SDK使用权限签名算法
signature
:
res
.
signature
,
// 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList
:
[
jsApiList
:
[
// "chooseImage",
"chooseImage"
,
// "shareToExternalContact",
"shareToExternalContact"
,
// "selectExternalContact",
"selectExternalContact"
,
// "selectEnterpriseContact",
"selectEnterpriseContact"
,
'startRecord'
,
],
],
});
});
...
@@ -131,10 +130,4 @@ export default class WechatApi {
...
@@ -131,10 +130,4 @@ export default class WechatApi {
});
});
});
});
}
}
static
startRecord
()
{
if
(
Platform
.
isWorkWx
())
{
wx
.
startRecord
();
}
}
}
}
src/modules/teach-tool/components/XMRecord.jsx
View file @
59bc8604
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Author: 吴文洁
* @Date: 2020-03-18 10:01:28
* @Date: 2020-03-18 10:01:28
* @LastEditors: yuananting
* @LastEditors: yuananting
* @LastEditTime: 2021-06-09 1
6:35:25
* @LastEditTime: 2021-06-09 1
9:45:21
* @Description: 录音组件
* @Description: 录音组件
*/
*/
...
@@ -35,7 +35,6 @@ class XMRecord extends Component {
...
@@ -35,7 +35,6 @@ class XMRecord extends Component {
componentDidMount
()
{
componentDidMount
()
{
// 获取录音设备
// 获取录音设备
this
.
getAudioRecorderDevice
();
this
.
getAudioRecorderDevice
();
WechatApi
.
initConfig
({
isAgentConfig
:
false
,
url
:
window
.
location
.
href
.
split
(
'#'
)[
0
]
})
}
}
componentWillUnmount
()
{}
componentWillUnmount
()
{}
...
@@ -87,18 +86,6 @@ class XMRecord extends Component {
...
@@ -87,18 +86,6 @@ class XMRecord extends Component {
};
};
handleStartRecord
=
()
=>
{
handleStartRecord
=
()
=>
{
alert
(
"是企微"
,
Platform
.
isWorkWx
())
if
(
Platform
.
isWorkWx
())
{
// 企业微信
alert
(
"进入"
)
WechatApi
.
startRecord
({
success
:
function
(
res
)
{
alert
(
"开始录音"
,
res
)
},
fail
:
function
(
res
)
{
alert
(
"未开始录音"
,
res
)
}
});
}
else
{
navigator
.
mediaDevices
navigator
.
mediaDevices
.
getUserMedia
({
.
getUserMedia
({
audio
:
true
,
audio
:
true
,
...
@@ -108,7 +95,6 @@ class XMRecord extends Component {
...
@@ -108,7 +95,6 @@ class XMRecord extends Component {
this
.
mMediaRecorder
.
start
();
this
.
mMediaRecorder
.
start
();
this
.
handleCountTime
();
this
.
handleCountTime
();
},
this
.
openDeviceFailure
);
},
this
.
openDeviceFailure
);
}
};
};
onProcessData
=
(
audioData
)
=>
{
onProcessData
=
(
audioData
)
=>
{
...
...
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