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
6d76db2c
Commit
6d76db2c
authored
Aug 04, 2021
by
zhujian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
241f9909
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
43 deletions
+51
-43
src/common/js/wechatApi.js
+23
-37
src/modules/root/CollegeManagePage.jsx
+4
-1
src/store/actions/basicAction.ts
+9
-2
src/store/actions/constants.ts
+3
-0
src/store/actions/index.ts
+5
-2
src/store/reducers/basicReducer.ts
+7
-1
No files found.
src/common/js/wechatApi.js
View file @
6d76db2c
...
@@ -29,30 +29,28 @@ export default class WechatApi {
...
@@ -29,30 +29,28 @@ export default class WechatApi {
signature
:
res
.
signature
,
// 必填,签名,见 附录-JS-SDK使用权限签名算法
signature
:
res
.
signature
,
// 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList
:
[
'chooseImage'
,
'shareToExternalContact'
,
'selectExternalContact'
,
'selectEnterpriseContact'
],
jsApiList
:
[
'chooseImage'
,
'shareToExternalContact'
,
'selectExternalContact'
,
'selectEnterpriseContact'
],
}).
then
(()
=>
{
}).
then
(()
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
Service
.
Hades
(
'anon/hades/getWxWorkJSAPISignature'
,
{
Service
.
Hades
(
'anon/hades/getWxWorkJSAPISignature'
,
{
storeId
:
User
.
getStoreId
(),
storeId
:
User
.
getStoreId
(),
url
:
params
.
url
,
url
:
params
.
url
,
}).
then
((
result2
)
=>
{
}).
then
((
result2
)
=>
{
const
res2
=
result2
.
result
;
const
res2
=
result2
.
result
;
this
.
agentConfig
({
this
.
agentConfig
({
corpid
:
res2
.
corpid
,
// 必填,企业微信的corpid,必须与当前登录的企业一致
corpid
:
res2
.
corpid
,
// 必填,企业微信的corpid,必须与当前登录的企业一致
agentid
:
res2
.
agentid
,
// 必填,企业微信的应用id (e.g. 1000247)
agentid
:
res2
.
agentid
,
// 必填,企业微信的应用id (e.g. 1000247)
timestamp
:
res2
.
timestamp
,
// 必填,生成签名的时间戳
timestamp
:
res2
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
res2
.
nonceStr
,
// 必填,生成签名的随机串
nonceStr
:
res2
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
res2
.
signature
,
// 必填,签名,见附录-JS-SDK使用权限签名算法
signature
:
res2
.
signature
,
// 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList
:
[
'selectExternalContact'
,
'getCurExternalContact'
,
'getContext'
,
'shareToExternalContact'
,
'sendChatMessage'
,
'shareToExternalChat'
],
jsApiList
:
[
'selectExternalContact'
,
'getCurExternalContact'
,
'getContext'
,
'shareToExternalContact'
,
'sendChatMessage'
,
'shareToExternalChat'
],
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
res
,
'res-agentconfig'
);
console
.
log
(
res
,
'res-agentconfig'
);
console
.
info
(
'window.WWOpenData'
,
window
.
WWOpenData
);
console
.
info
(
'window.WWOpenData'
,
window
.
WWOpenData
);
resolve
(
res
);
resolve
(
res
);
},
},
fail
:
(
err
)
=>
{
fail
:
(
err
)
=>
{
console
.
log
(
1213545344545
)
console
.
log
(
1213545344545
)
console
.
log
(
err
,
'err-agentconfig'
);
console
.
log
(
err
,
'err-agentconfig'
);
reject
(
err
);
reject
(
err
);
},
},
});
});
});
});
});
...
@@ -112,19 +110,7 @@ export default class WechatApi {
...
@@ -112,19 +110,7 @@ export default class WechatApi {
}
}
static
async
agentConfig
(
config
)
{
static
async
agentConfig
(
config
)
{
return
new
Promise
((
success
,
fail
)
=>
{
wx
.
agentConfig
({
...
config
});
console
.
info
(
'wx.agentConfig'
,
config
);
wx
.
agentConfig
({
...
config
,
success
,
fail
});
}).
then
(
(
res
)
=>
{
console
.
info
(
'wx.agentConfig success'
,
res
);
return
res
;
},
(
error
)
=>
{
console
.
error
(
'wx.agentConfig fail'
,
error
);
throw
error
;
}
);
}
}
static
getCurExternalContact
()
{
static
getCurExternalContact
()
{
...
...
src/modules/root/CollegeManagePage.jsx
View file @
6d76db2c
...
@@ -249,7 +249,10 @@ export default class CollegeManagePage extends React.Component {
...
@@ -249,7 +249,10 @@ export default class CollegeManagePage extends React.Component {
<
img
className=
"image"
src=
{
avatar
}
/>
<
img
className=
"image"
src=
{
avatar
}
/>
<
span
className=
"name"
>
<
span
className=
"name"
>
{
name
}
{
name
}
{
/* <WWOpenDataCom type="userName" openid={name}/> */
}
{
<
WWOpenDataCom
type=
"userName"
openid=
{
name
}
/>
}
</
span
>
</
span
>
<
span
<
span
className=
"logout"
className=
"logout"
...
...
src/store/actions/basicAction.ts
View file @
6d76db2c
...
@@ -10,7 +10,8 @@ import {
...
@@ -10,7 +10,8 @@ import {
STORE_GROUP_PERMISSION
,
STORE_GROUP_PERMISSION
,
STORE_PERMISSION
,
STORE_PERMISSION
,
STORE_GROUP_LIST
,
STORE_GROUP_LIST
,
STORE_LIST
STORE_LIST
,
WECHAT_LOGIN
}
from
'./constants'
}
from
'./constants'
...
@@ -34,12 +35,18 @@ const setStoreList = (payload: any) => ({
...
@@ -34,12 +35,18 @@ const setStoreList = (payload: any) => ({
payload
payload
})
})
const
setWechatLogin
=
(
payload
:
any
)
=>
({
type
:
WECHAT_LOGIN
,
payload
})
export
{
export
{
setStoreGroupPermission
,
setStoreGroupPermission
,
setStorePermission
,
setStorePermission
,
setStoreGroupList
,
setStoreGroupList
,
setStoreList
setStoreList
,
setWechatLogin
}
}
src/store/actions/constants.ts
View file @
6d76db2c
...
@@ -10,11 +10,13 @@ const STORE_GROUP_PERMISSION = 'STORE_GROUP_PERMISSION';
...
@@ -10,11 +10,13 @@ const STORE_GROUP_PERMISSION = 'STORE_GROUP_PERMISSION';
const
STORE_PERMISSION
=
'STORE_PERMISSION'
;
const
STORE_PERMISSION
=
'STORE_PERMISSION'
;
const
STORE_GROUP_LIST
=
'STORE_GROUP_LIST'
;
const
STORE_GROUP_LIST
=
'STORE_GROUP_LIST'
;
const
STORE_LIST
=
'STORE_LIST'
;
const
STORE_LIST
=
'STORE_LIST'
;
const
WECHAT_LOGIN
=
'WECHAT_LOGIN'
;
export
{
export
{
STORE_GROUP_PERMISSION
,
STORE_GROUP_PERMISSION
,
STORE_PERMISSION
,
STORE_PERMISSION
,
STORE_GROUP_LIST
,
STORE_GROUP_LIST
,
STORE_LIST
,
STORE_LIST
,
WECHAT_LOGIN
,
}
}
\ No newline at end of file
src/store/actions/index.ts
View file @
6d76db2c
...
@@ -4,12 +4,14 @@ import {
...
@@ -4,12 +4,14 @@ import {
setStoreGroupPermission
,
setStoreGroupPermission
,
setStorePermission
,
setStorePermission
,
setStoreGroupList
,
setStoreGroupList
,
setStoreList
setStoreList
,
setWechatLogin
}
from
'./basicAction'
;
}
from
'./basicAction'
;
export
{
export
{
setStoreGroupPermission
,
setStoreGroupPermission
,
setStorePermission
,
setStorePermission
,
setStoreGroupList
,
setStoreGroupList
,
setStoreList
setStoreList
,
setWechatLogin
}
}
\ No newline at end of file
src/store/reducers/basicReducer.ts
View file @
6d76db2c
...
@@ -10,7 +10,8 @@ import {
...
@@ -10,7 +10,8 @@ import {
STORE_GROUP_PERMISSION
,
STORE_GROUP_PERMISSION
,
STORE_PERMISSION
,
STORE_PERMISSION
,
STORE_GROUP_LIST
,
STORE_GROUP_LIST
,
STORE_LIST
STORE_LIST
,
WECHAT_LOGIN
,
}
from
'@/store/actions/constants'
;
}
from
'@/store/actions/constants'
;
import
_
from
'underscore'
;
import
_
from
'underscore'
;
import
Permission
from
'@/common/js/permission'
;
import
Permission
from
'@/common/js/permission'
;
...
@@ -45,6 +46,11 @@ const basicReducer = (state: any, action: any) => {
...
@@ -45,6 +46,11 @@ const basicReducer = (state: any, action: any) => {
return
Object
.
assign
({},
state
,
{
return
Object
.
assign
({},
state
,
{
storeList
,
storeList
,
});
});
case
WECHAT_LOGIN
:
const
wechatLogin
:
any
=
action
.
payload
;
return
Object
.
assign
({},
state
,
{
wechatLogin
,
});
default
:
default
:
return
state
;
return
state
;
}
}
...
...
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