Commit 6d76db2c by zhujian

fix

parent 241f9909
...@@ -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() {
......
...@@ -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"
......
...@@ -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
} }
...@@ -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
...@@ -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
...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment