@dypnb/dev-tools 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/publishServer/index.browser.js +1 -1
- package/dist/publishServer/index.cjs +1 -1
- package/dist/publishServer/index.mjs +1 -1
- package/package.json +1 -2
- package/src/dome.vue +0 -25
- package/src/gen-page/config.js +0 -40
- package/src/gen-page/index.js +0 -122
- package/src/gen-page/template.js +0 -568
- package/src/gen-swagger/index.js +0 -228
- package/src/index.js +0 -12
- package/src/publish-server/index.js +0 -130
- package/src/publish-server/index.mjs +0 -130
- package/src/utils/index.js +0 -82
- package/src/wx-server-notice/README.md +0 -59
- package/src/wx-server-notice/api.js +0 -45
- package/src/wx-server-notice/images/qiyewx-1.png +0 -0
- package/src/wx-server-notice/images/qiyewx-2.png +0 -0
- package/src/wx-server-notice/images/qiyewx-3-1.png +0 -0
- package/src/wx-server-notice/images/qiyewx-3-2.png +0 -0
- package/src/wx-server-notice/images/qiyewx-3.png +0 -0
- package/src/wx-server-notice/images/qiyewx-4.png +0 -0
- package/src/wx-server-notice/images/qiyewx-5-1.jpg +0 -0
- package/src/wx-server-notice/images/qiyewx-5.jpg +0 -0
- package/src/wx-server-notice/images/qiyewx-6.png +0 -0
- package/src/wx-server-notice/index.js +0 -62
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,62 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @name WXbot
|
3
|
-
* @description 获取环境变量参数,执行微信消息通知函数
|
4
|
-
*/
|
5
|
-
import { getGlobalConfig, errorLog, successLog, } from "../utils/index.js";
|
6
|
-
import { getToken, postMsg } from "./api.js";
|
7
|
-
|
8
|
-
async function getWxServerConfig() {
|
9
|
-
return await getGlobalConfig('wxServerConfig');
|
10
|
-
}
|
11
|
-
|
12
|
-
// 主函数
|
13
|
-
export async function wxNotify(config, wxServerConfig) {
|
14
|
-
let configs= {};
|
15
|
-
if (wxServerConfig && Object.keys(wxServerConfig).length !== 0) {
|
16
|
-
configs = wxServerConfig;
|
17
|
-
} else {
|
18
|
-
configs = await getWxServerConfig();
|
19
|
-
}
|
20
|
-
|
21
|
-
const { WX_COMPANY_ID, WX_APP_ID, WX_APP_SECRET } = configs ;
|
22
|
-
|
23
|
-
try {
|
24
|
-
// 获取token
|
25
|
-
const accessToken = await getToken({
|
26
|
-
id: WX_COMPANY_ID,
|
27
|
-
secret: WX_APP_SECRET
|
28
|
-
});
|
29
|
-
|
30
|
-
// 发送消息
|
31
|
-
const defaultConfig = {
|
32
|
-
msgtype: "text",
|
33
|
-
agentid: WX_APP_ID,
|
34
|
-
...config
|
35
|
-
};
|
36
|
-
const option = { ...defaultConfig, ...config };
|
37
|
-
const res = await postMsg(accessToken, option);
|
38
|
-
successLog("wx:信息发送成功!", res);
|
39
|
-
return true;
|
40
|
-
} catch (error) {
|
41
|
-
errorLog("wx:信息发送失败!", error);
|
42
|
-
return false;
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
// wxNotify({
|
47
|
-
// msgtype: "text",
|
48
|
-
// text: {
|
49
|
-
// content: `${moment().format('lll')}`
|
50
|
-
// }
|
51
|
-
// });
|
52
|
-
|
53
|
-
// wxNotify({
|
54
|
-
// msgtype: "textcard",
|
55
|
-
// textcard: {
|
56
|
-
// title: "应用发布提醒",
|
57
|
-
// description:
|
58
|
-
// '<div class="gray">2016年9月26日</div> <div class="normal">恭喜你抽中iPhone 7一台,领奖码:xxxx</div><div class="highlight">请于2016年10月10日前联系行政同事领取</div>',
|
59
|
-
// url: "www.baidu.com",
|
60
|
-
// btntxt: "更多"
|
61
|
-
// }
|
62
|
-
// });
|