Commit 60eb28a2 by zhangleyuan

feat:解决合并代码后的冲突

parents f1fdeb6e 16af0617
......@@ -12,32 +12,34 @@ import Platform from '@/common/js/platform';
import User from '@/common/js/user';
import Service from '@/common/js/service';
console.log(wx.agentConfig,' console.log(wx.agentConfig) ')
export default class WechatApi {
static async initConfig(params = { isAgentConfig: false, url: '' }) {
static initConfig(params = { isAgentConfig: false, url: '' }) {
if (Platform.isWorkWx()) {
return new Promise(async (resolve, reject) => {
Service.Hades('anon/hades/getWxCorpJSAPISignature', {
storeId: User.getStoreId(),
url: params.url,
url: window.location.href.split('#')[0],
}).then((result) => {
const res = result.result;
this.config({
wx.config({
beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: res.appId, // 必填,企业微信的corpID
timestamp: res.timestamp, // 必填,生成签名的时间戳
nonceStr: res.nonceStr, // 必填,生成签名的随机串
signature: res.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
jsApiList: ['chooseImage', 'shareToExternalContact', 'selectExternalContact', 'selectEnterpriseContact'],
}).then(() => {
jsApiList: ['scanQRCode'],
});
})
wx.ready(() => {
Service.Hades('anon/hades/getWxWorkJSAPISignature', {
storeId: User.getStoreId(),
url: params.url,
url: window.location.href.split('#')[0],
}).then((result2) => {
const res2 = result2.result;
setTimeout(() => {
this.agentConfig({
wx.agentConfig({
corpid: res2.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: res2.agentid, // 必填,企业微信的应用id (e.g. 1000247)
timestamp: res2.timestamp, // 必填,生成签名的时间戳
......@@ -45,36 +47,33 @@ export default class WechatApi {
signature: res2.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['selectExternalContact', 'getCurExternalContact', 'getContext', 'shareToExternalContact', 'sendChatMessage', 'shareToExternalChat', 'startLiving', 'replayLiving'],
success: (res) => {
console.log(res, 'res-agentconfig');
console.info('window.WWOpenData', window.WWOpenData);
console.log(res, 'agentConfig 成功', 'res-agentconfig');
resolve(res);
},
fail: (err) => {
console.log(1213545344545)
console.log(err, 'err-agentconfig');
reject(err);
},
});
}, 500)
});
});
wx.error((err) => {
console.log('getWxCorpJSAPISignature', err)
});
})
});
})
} else {
if (params.isAgentConfig) {
console.log(32132132, 'cesgu')
return new Promise(async (resolve, reject) => {
Service.Hades('anon/hades/getWxWorkJSAPISignature', {
storeId: User.getStoreId(),
url: params.url,
url: window.location.href.split('#')[0],
}).then((result2) => {
const res2 = result2.result;
this.agentConfig({
wx.agentConfig({
corpid: res2.corpid, // 必填,企业微信的corpid,必须与当前登录的企业一致
agentid: res2.agentid, // 必填,企业微信的应用id (e.g. 1000247)
timestamp: res2.timestamp, // 必填,生成签名的时间戳
......@@ -82,14 +81,13 @@ export default class WechatApi {
signature: res2.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法
jsApiList: ['selectExternalContact', 'getCurExternalContact', 'getContext', 'shareToExternalContact', 'sendChatMessage', 'shareToExternalChat', 'startLiving', 'replayLiving'],
success: (res) => {
console.log(res, 'res-agentconfig');
console.info('window.WWOpenData', window.WWOpenData);
console.log(res, 'agentConfig 成功', 'res-agentconfig');
resolve(res);
},
fail: (err) => {
console.log(1213545344545)
console.log(err, 'err-agentconfig');
reject(err);
},
});
});
......@@ -97,42 +95,6 @@ export default class WechatApi {
}
}
}
static async config(config) {
return new Promise((resolve, reject) => {
console.info('wx.config', config);
wx.config(config);
wx.ready(resolve);
wx.error(reject);
}).then(
() => {
console.info('wx.ready');
},
(error) => {
console.error('wx.error', error);
throw error;
}
);
}
static async agentConfig(config) {
wx.agentConfig({ ...config });
}
static getCurExternalContact() {
return new Promise((resolve, reject) => {
wx.ready(() => {
wx.invoke('getCurExternalContact', {}, function (res) {
if (res.err_msg == 'getCurExternalContact:ok') {
resolve(res.userId); //返回当前外部联系人userId
} else {
reject(res.err_msg); //错误处理
}
});
});
});
}
static getContext() {
return new Promise((resolve, reject) => {
......
......@@ -2,7 +2,7 @@
* @Author: 吴文洁
* @Date: 2020-08-24 12:20:57
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-08-11 20:25:11
* @LastEditTime: 2021-08-12 15:58:30
* @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有
-->
......@@ -41,17 +41,25 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>小麦企学院</title>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
<script type="text/javascript" src="https://image.xiaomaiketang.com/xm/iscroll-zoom-min.js"></script>
<script type="text/javascript" src="https://image.xiaomaiketang.com/xm/hammer.min.js"></script>
<script type="text/javascript" src="https://image.xiaomaiketang.com/xm/lrz.all.bundle.js"></script>
<script type="text/javascript" src="https://image.xiaomaiketang.com/xm/PhotoClip.js"></script>
<script type="text/javascript" charset="utf-8" src="//g.alicdn.com/sd/ncpc/nc.js?t=2015052012"></script>
<script type="text/javascript" src="https://xiaomai-js.oss-cn-hangzhou.aliyuncs.com/loghub-xm-0.0.1-beta.js"></script>
<script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript" src="//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
</head>
<body>
<script>
setTimeout(()=>{
if(!wx.agentConfig){
window.location.reload()
}
},100)
</script>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
......
......@@ -523,7 +523,7 @@ function LeftStructureTree(props) {
<div className="organization">
<div className="search-con">
{/* <Complete/> */}
{/* <AutoComplete
<AutoComplete
dropdownClassName="certain-category-search-dropdown"
dropdownMatchSelectWidth={250}
allowClear
......@@ -545,7 +545,7 @@ function LeftStructureTree(props) {
style={{ width: 250 }}
enterButton={<span className='icon iconfont'>&#xe832;</span>}
/>
</AutoComplete> */}
</AutoComplete>
</div>
{(props.treeType === 'postGrouptab' || props.treeType === 'customGroupTab') && (
<div className="operate">
......
......@@ -64,7 +64,6 @@ function MemberTree(props) {
_selectNodes.push(item);
}
})
console.log('_selectNodes',_selectNodes);
props.onSelect(_selectNodes);
}
return (
......
......@@ -9,6 +9,9 @@
}
}
.ant-tree.ant-tree-directory .ant-tree-treenode-selected:hover::before, .ant-tree.ant-tree-directory .ant-tree-treenode-selected::before{
background: none;
background:transparent;
}
.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-switcher{
color:#000;
}
}
\ No newline at end of file
......@@ -58,14 +58,13 @@ function SearchUser(props) {
};
return (
<div className="search-user" style={{width:'300px'}} id="search-user">
{/* <Search
<Search
placeholder='搜索成员'
enterButton={<span className="icon iconfont">&#xe832;</span>}
onFocus={(e)=>{onFocus(e)}}
onChange={(e)=>{onChange(e)}}
className="search-input-item"
// onBlur={()=>{onBlur()}}
/> */}
/>
{dropDownVisible &&
<div className="drop-down">
<div className="drop-down__list">
......
......@@ -23,7 +23,7 @@
}
.container-left-body-table{
width: 300px;
height: 330px;
max-height: 380px;
overflow: scroll;
.ant-table {
border: none;
......
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