This commit is contained in:
wenjiarui 2023-02-16 12:01:46 +08:00
commit 7d066a7026
21 changed files with 105 additions and 150 deletions

View File

@ -17,7 +17,7 @@ var uuid_2 = require("oak-domain/lib/utils/uuid");
*/ */
function createWechatQrCode(options, context) { function createWechatQrCode(options, context) {
return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__awaiter(this, void 0, void 0, function () {
var entity, entityId, tag, _a, permanent, props, qrCodeType, applicationId, _b, system, appId, appType, url, _c, applications, sysConfig, id, self_1, self_2, publicApp, mpApp, data, type, application, applicationType, config, _d, config2, appId_1, appSecret, wechatInstance, url_1, buffer, str, config2, appId_2, appSecret, wechatInstance, result; var entity, entityId, tag, _a, permanent, props, qrCodeType, applicationId, _b, system, appId, appType, url, _c, applications, sysConfig, id, self_1, self_2, self_3, self_4, publicApp, mpApp, data, type, application, applicationType, config, _d, config2, appId_1, appSecret, wechatInstance, url_1, buffer, str, config2, appId_2, appSecret, wechatInstance, result;
return tslib_1.__generator(this, function (_e) { return tslib_1.__generator(this, function (_e) {
switch (_e.label) { switch (_e.label) {
case 0: case 0:
@ -64,28 +64,30 @@ function createWechatQrCode(options, context) {
} }
id = (0, uuid_1.generateNewId)(); id = (0, uuid_1.generateNewId)();
if (qrCodeType) { if (qrCodeType) {
self_1 = applications.find(function (ele) { return ele.id === applicationId; });
switch (qrCodeType) { switch (qrCodeType) {
case 'wechatPublic': { case 'wechatPublic': {
if (!(self_1.type === 'wechatPublic' && self_1 = applications.find(function (ele) { return ele.type === 'wechatPublic'; });
if (!(self_1 && self_1.type === 'wechatPublic' &&
self_1.config.isService)) { self_1.config.isService)) {
throw new Error('无法生成公众号二维码,服务号未正确配置'); throw new Error('无法生成公众号二维码,服务号未正确配置');
} }
appId = applicationId; appId = self_1.id;
appType = 'wechatPublic'; appType = 'wechatPublic';
break; break;
} }
case 'wechatMpDomainUrl': { case 'wechatMpDomainUrl': {
if (!(self_1.type === 'wechatMp' && self_2 = applications.find(function (ele) { return ele.type === 'wechatMp'; });
self_1.config.qrCodePrefix)) { if (!(self_2.type === 'wechatMp' &&
self_2.config.qrCodePrefix)) {
throw new Error('无法生成小程序地址码,未配置跳转前缀'); throw new Error('无法生成小程序地址码,未配置跳转前缀');
} }
url = "".concat(self_1.config.qrCodePrefix, "/").concat(id); url = "".concat(self_2.config.qrCodePrefix, "/").concat(id);
appType = 'wechatMpDomainUrl'; appType = 'wechatMpDomainUrl';
break; break;
} }
case 'wechatMpWxaCode': { case 'wechatMpWxaCode': {
if (self_1.type !== 'wechatMp') { self_3 = applications.find(function (ele) { return ele.type === 'wechatMp'; });
if (self_3.type !== 'wechatMp') {
throw new Error('无法生成小程序地址码,未配置跳转前缀'); throw new Error('无法生成小程序地址码,未配置跳转前缀');
} }
appType = 'wechatMpWxaCode'; appType = 'wechatMpWxaCode';
@ -102,19 +104,19 @@ function createWechatQrCode(options, context) {
appType = sysConfig.App.qrCodeType; appType = sysConfig.App.qrCodeType;
} }
else { else {
self_2 = applications.find(function (ele) { return ele.id === applicationId; }); self_4 = applications.find(function (ele) { return ele.id === applicationId; });
// 如果本身是服务号,则优先用自己的 // 如果本身是服务号,则优先用自己的
if (self_2.type === 'wechatPublic' && if (self_4.type === 'wechatPublic' &&
self_2.config.isService) { self_4.config.isService) {
appId = applicationId; appId = applicationId;
appType = 'wechatPublic'; appType = 'wechatPublic';
} }
else if ((self_2 === null || self_2 === void 0 ? void 0 : self_2.type) === 'wechatMp') { else if ((self_4 === null || self_4 === void 0 ? void 0 : self_4.type) === 'wechatMp') {
// 如果本身是小程序,则次优先用小程序的地址码,再次优先用二维码 // 如果本身是小程序,则次优先用小程序的地址码,再次优先用二维码
appId = self_2.id; appId = self_4.id;
if (self_2.config.qrCodePrefix) { if (self_4.config.qrCodePrefix) {
appType = 'wechatMpDomainUrl'; appType = 'wechatMpDomainUrl';
url = "".concat(self_2.config.qrCodePrefix, "/").concat(id); url = "".concat(self_4.config.qrCodePrefix, "/").concat(id);
} }
else { else {
appType = 'wechatMpWxaCode'; appType = 'wechatMpWxaCode';

View File

@ -5,6 +5,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd"); var antd_1 = require("antd");
var icons_1 = require("@ant-design/icons"); var icons_1 = require("@ant-design/icons");
var dayjs_1 = tslib_1.__importDefault(require("dayjs")); var dayjs_1 = tslib_1.__importDefault(require("dayjs"));
var qrcode_react_1 = require("qrcode.react");
require("./index.less"); require("./index.less");
function isBase64(url) { function isBase64(url) {
return /data:image\/[\w|\W]+(;base64,)$/.test(url); return /data:image\/[\w|\W]+(;base64,)$/.test(url);
@ -33,7 +34,8 @@ function QrCode(props) {
return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ id: "oakQrCode", className: "".concat(prefixCls, "-qrCodeBox") }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: "".concat(prefixCls, "-qrCodeBox_imgBox"), style: { return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ id: "oakQrCode", className: "".concat(prefixCls, "-qrCodeBox") }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: "".concat(prefixCls, "-qrCodeBox_imgBox"), style: {
width: size, width: size,
height: size, height: size,
} }, { children: isBase64(url) ? ((0, jsx_runtime_1.jsx)("img", { src: url, alt: "qrCode", width: size, height: size })) : (url ? (0, jsx_runtime_1.jsx)(antd_1.QRCode, { value: url, size: size }) : null) })), V, tips, (0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ className: "".concat(prefixCls, "-qrCodeBox_actions") }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "text", onClick: function () { marginBottom: 10
} }, { children: isBase64(url) ? ((0, jsx_runtime_1.jsx)("img", { src: url, alt: "qrCode", width: size, height: size })) : url ? ((0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeCanvas, { value: url, size: size })) : null })), V, tips, (0, jsx_runtime_1.jsxs)(antd_1.Space, tslib_1.__assign({ className: "".concat(prefixCls, "-qrCodeBox_actions") }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "text", onClick: function () {
var _a; var _a;
if (typeof onDownload === 'function') { if (typeof onDownload === 'function') {
onDownload(url, filename); onDownload(url, filename);

View File

@ -28,7 +28,7 @@ function Grant(props) {
if (dev) { if (dev) {
V = ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev") }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_header") }, { children: [(0, jsx_runtime_1.jsx)("input", { maxLength: 6, value: code, className: "".concat(prefixCls2, "_dev_header_input"), onChange: function (e) { V = ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev") }, { children: [(0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_header") }, { children: [(0, jsx_runtime_1.jsx)("input", { maxLength: 6, value: code, className: "".concat(prefixCls2, "_dev_header_input"), onChange: function (e) {
setCode(e.target.value); setCode(e.target.value);
} }), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", shape: "round", size: "large", } }), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_header_btn"), type: "primary", shape: "round", size: "large",
// block // block
onClick: function () { onClick: function () {
if (disabled) { if (disabled) {
@ -41,7 +41,7 @@ function Grant(props) {
} }, { children: "\u5FAE\u4FE1\u6388\u6743\u4E00\u952E\u767B\u5F55" }))] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_bottom") }, { children: [(0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_bottom_desc") }, { children: "1\u3001\u7531\u4E8E\u672C\u5730\u5F00\u53D1\u73AF\u5883\u9650\u5236\uFF0C\u6A21\u62DF\u5FAE\u4FE1\u6388\u6743\u540E\u52A8\u4F5C" })), (0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_bottom_desc") }, { children: "2\u3001CODE\u53EF\u4FEE\u6539" }))] }))] }))); } }, { children: "\u5FAE\u4FE1\u6388\u6743\u4E00\u952E\u767B\u5F55" }))] })), (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_bottom") }, { children: [(0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_bottom_desc") }, { children: "1\u3001\u7531\u4E8E\u672C\u5730\u5F00\u53D1\u73AF\u5883\u9650\u5236\uFF0C\u6A21\u62DF\u5FAE\u4FE1\u6388\u6743\u540E\u52A8\u4F5C" })), (0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: "".concat(prefixCls2, "_dev_bottom_desc") }, { children: "2\u3001CODE\u53EF\u4FEE\u6539" }))] }))] })));
} }
else { else {
V = ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_prod") }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_prod_header") }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", shape: "round", size: "large", V = ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_prod") }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: "".concat(prefixCls2, "_prod_header") }, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ className: "".concat(prefixCls2, "_prod_header_btn"), type: "primary", shape: "round", size: "large",
// block // block
onClick: function () { onClick: function () {
if (disabled) { if (disabled) {

View File

@ -27,19 +27,7 @@
&_btn { &_btn {
margin-top: 16px; margin-top: 16px;
width: 80px; margin-bottom: 16px;
height: 80px;
border-radius: 40px;
background-color: transparent;
color: #000000d9;
border: 1px solid #d9d9d9;
font-size: 14px;
line-height: 24px;
box-shadow: 0 2px #00000004;
cursor: pointer;
transition: .3s;
} }
} }
@ -47,7 +35,6 @@
&_bottom { &_bottom {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 16px;
&_title { &_title {
font-size: 13px; font-size: 13px;
@ -80,51 +67,14 @@
&_btn { &_btn {
margin-top: 16px; margin-top: 16px;
width: 80px; margin-bottom: 16px;
height: 80px;
border-radius: 40px;
background-color: transparent;
color: #000000d9;
border: 1px solid #d9d9d9;
font-size: 14px;
line-height: 24px;
box-shadow: 0 2px #00000004;
cursor: pointer;
transition: .3s;
} }
&_btn:hover {
color: var(--oak-color-primary);
border-color: currentColor;
}
&_btn::after {
/*其他样式*/
opacity: 0;
box-shadow: 0 0 0 6px var(--oak-color-primary);
transition: .3s;
}
/*点击*/
&_btn:active::after {
box-shadow: none;
opacity: 0.4;
transition: 0s;
/*取消过渡*/
}
} }
&_bottom { &_bottom {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 16px;
&_title { &_title {
font-size: 13px; font-size: 13px;

View File

@ -102,7 +102,9 @@ function Tencent(props) {
? sms.map(function (ele, idx) { return ({ ? sms.map(function (ele, idx) { return ({
key: "".concat(idx), key: "".concat(idx),
label: "\u77ED\u4FE1".concat(idx + 1), label: "\u77ED\u4FE1".concat(idx + 1),
children: ((0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "smsSdkAppId", name: "smsSdkAppId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165smsSdkAppId", type: "text", value: ele.smsSdkAppId, onChange: function (e) { children: ((0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: false, labelAlign: "left", layout: "vertical", style: { marginTop: 10 } }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "secretId", name: "secretId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165secretId", type: "text", value: ele.secretId, onChange: function (e) {
return setValue("".concat(idx, ".secretId"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "smsSdkAppId", name: "smsSdkAppId" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165smsSdkAppId", type: "text", value: ele.smsSdkAppId, onChange: function (e) {
return setValue("".concat(idx, ".smsSdkAppId"), e.target.value); return setValue("".concat(idx, ".smsSdkAppId"), e.target.value);
} }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "defaultSignName", name: "defaultSignName" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165defaultSignName", type: "text", value: ele.defaultSignName, onChange: function (e) { } }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "defaultSignName", name: "defaultSignName" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165defaultSignName", type: "text", value: ele.defaultSignName, onChange: function (e) {
return setValue("".concat(idx, ".defaultSignName"), e.target.value); return setValue("".concat(idx, ".defaultSignName"), e.target.value);

View File

@ -50,6 +50,13 @@ var locale = {
grant: '授予', grant: '授予',
transfer: '转交', transfer: '转交',
}, },
qrCodeType: {
webForWechatPublic: '网站引流到公众号',
wechatMpDomainUrl: '小程序url码',
wechatMpWxaCode: '小程序码',
wechatPublic: '公众号关注码',
wechatPublicForMp: '公众号回复小程序码',
}
}, },
}, },
}; };

View File

@ -52,5 +52,14 @@ var locale = {
application: '应用', application: '应用',
props: '属性', props: '属性',
}, },
v: {
type: {
webForWechatPublic: '网站引流到公众号',
wechatMpDomainUrl: '小程序url码',
wechatMpWxaCode: '小程序码',
wechatPublic: '公众号关注码',
wechatPublicForMp: '公众号回复小程序码',
}
}
}, },
}; };

View File

@ -1,2 +1,2 @@
declare const _default: (import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "address", import("../types/RuntimeCxt").RuntimeCxt> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "user", import("../types/RuntimeCxt").RuntimeCxt> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "userEntityGrant", import("../types/RuntimeCxt").RuntimeCxt> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "wechatQrCode", import("../types/RuntimeCxt").RuntimeCxt>)[]; declare const _default: (import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "message", import("../types/RuntimeCxt").BRC> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "address", import("../types/RuntimeCxt").RuntimeCxt> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "user", import("../types/RuntimeCxt").RuntimeCxt> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "userEntityGrant", import("../types/RuntimeCxt").RuntimeCxt> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "wechatQrCode", import("../types/RuntimeCxt").RuntimeCxt> | import("oak-domain/lib/types").Trigger<import("../general-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../general-app-domain").EntityDict>>)[];
export default _default; export default _default;

View File

@ -5,4 +5,6 @@ var address_1 = tslib_1.__importDefault(require("./address"));
var user_1 = tslib_1.__importDefault(require("./user")); var user_1 = tslib_1.__importDefault(require("./user"));
var userEntityGrant_1 = tslib_1.__importDefault(require("./userEntityGrant")); var userEntityGrant_1 = tslib_1.__importDefault(require("./userEntityGrant"));
var wechatQrCode_1 = tslib_1.__importDefault(require("./wechatQrCode")); var wechatQrCode_1 = tslib_1.__importDefault(require("./wechatQrCode"));
exports.default = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(address_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false); var message_1 = tslib_1.__importDefault(require("./message"));
var notification_1 = tslib_1.__importDefault(require("./notification"));
exports.default = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(address_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false), tslib_1.__read(message_1.default), false), tslib_1.__read(notification_1.default), false);

View File

@ -131,10 +131,6 @@ function createNotification(message, context) {
} }
return true; return true;
}); });
if (channels.length === 0) {
console.warn("\u7C7B\u578B\u4E3A".concat(type, "\u7684\u6D88\u606F\u5728\u751F\u6210\u65F6\uFF0C\u5C1D\u8BD5\u4E3A\u4E4B\u751F\u6210\u901A\u77E5\uFF0C\u627E\u4E0D\u5230\u53EF\u63A8\u9001\u7684channel"));
return [2 /*return*/, 0];
}
messageSentCount = 0; messageSentCount = 0;
messageSystemDatas = []; messageSystemDatas = [];
return [4 /*yield*/, Promise.all(systems.map(function (system) { return tslib_1.__awaiter(_this, void 0, void 0, function () { return [4 /*yield*/, Promise.all(systems.map(function (system) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
@ -360,9 +356,10 @@ function createNotification(message, context) {
_c.action = 'create', _c.action = 'create',
_c.data = notificationDatas, _c.data = notificationDatas,
_c); _c);
messageSystemDatas.push(messageSystemData);
_d.label = 6; _d.label = 6;
case 6: return [2 /*return*/]; case 6:
messageSystemDatas.push(messageSystemData);
return [2 /*return*/];
} }
}); });
}); }))]; }); }))];

View File

@ -47,6 +47,7 @@ var triggers = [
oakId: id, oakId: id,
}, },
}, },
type: userEntityGrantData.qrCodeType,
}, context)]; }, context)];
case 1: case 1:
// 为之创建微信体系下的一个weChatQrCode // 为之创建微信体系下的一个weChatQrCode

View File

@ -1,6 +1,6 @@
{ {
"name": "oak-general-business", "name": "oak-general-business",
"version": "2.5.2", "version": "2.5.3",
"description": "oak框架中公共业务逻辑的实现", "description": "oak框架中公共业务逻辑的实现",
"author": { "author": {
"name": "XuChang" "name": "XuChang"
@ -31,7 +31,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"@ant-design/icons": "^4.7.0", "@ant-design/icons": "^4.7.0",
"antd": "^5.2.1", "antd": "^5.2.0",
"antd-mobile": "^5.24.1", "antd-mobile": "^5.24.1",
"antd-mobile-icons": "^0.3.0", "antd-mobile-icons": "^0.3.0",
"react": ">=18.2.0", "react": ">=18.2.0",
@ -56,7 +56,7 @@
"@types/react-dom": "^18.0.5", "@types/react-dom": "^18.0.5",
"@types/sha1": "^1.1.3", "@types/sha1": "^1.1.3",
"@types/uuid": "^8.3.0", "@types/uuid": "^8.3.0",
"antd": "^5.2.1", "antd": "^5.2.0",
"antd-mobile": "^5.24.1", "antd-mobile": "^5.24.1",
"antd-mobile-icons": "^0.3.0", "antd-mobile-icons": "^0.3.0",
"assert": "^2.0.0", "assert": "^2.0.0",

View File

@ -1,7 +1,8 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Button, Space, QRCode } from 'antd'; import { Button, Space } from 'antd';
import { DownloadOutlined, ReloadOutlined } from '@ant-design/icons'; import { DownloadOutlined, ReloadOutlined } from '@ant-design/icons';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { QRCodeCanvas } from 'qrcode.react';
import './index.less'; import './index.less';
@ -77,13 +78,14 @@ function QrCode(props: IQrCodeProps) {
style={{ style={{
width: size, width: size,
height: size, height: size,
marginBottom: 10
}} }}
> >
{isBase64(url) ? ( {isBase64(url) ? (
<img src={url} alt="qrCode" width={size} height={size} /> <img src={url} alt="qrCode" width={size} height={size} />
) : ( ) : url ? (
url ? <QRCode value={url} size={size} /> : null <QRCodeCanvas value={url} size={size} />
)} ) : null}
</div> </div>
{V} {V}
{tips} {tips}

View File

@ -27,19 +27,7 @@
&_btn { &_btn {
margin-top: 16px; margin-top: 16px;
width: 80px; margin-bottom: 16px;
height: 80px;
border-radius: 40px;
background-color: transparent;
color: #000000d9;
border: 1px solid #d9d9d9;
font-size: 14px;
line-height: 24px;
box-shadow: 0 2px #00000004;
cursor: pointer;
transition: .3s;
} }
} }
@ -47,7 +35,6 @@
&_bottom { &_bottom {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 16px;
&_title { &_title {
font-size: 13px; font-size: 13px;
@ -80,51 +67,14 @@
&_btn { &_btn {
margin-top: 16px; margin-top: 16px;
width: 80px; margin-bottom: 16px;
height: 80px;
border-radius: 40px;
background-color: transparent;
color: #000000d9;
border: 1px solid #d9d9d9;
font-size: 14px;
line-height: 24px;
box-shadow: 0 2px #00000004;
cursor: pointer;
transition: .3s;
} }
&_btn:hover {
color: var(--oak-color-primary);
border-color: currentColor;
}
&_btn::after {
/*其他样式*/
opacity: 0;
box-shadow: 0 0 0 6px var(--oak-color-primary);
transition: .3s;
}
/*点击*/
&_btn:active::after {
box-shadow: none;
opacity: 0.4;
transition: 0s;
/*取消过渡*/
}
} }
&_bottom { &_bottom {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 16px;
&_title { &_title {
font-size: 13px; font-size: 13px;

View File

@ -66,6 +66,7 @@ function Grant(props: GrantProps) {
}} }}
></input> ></input>
<Button <Button
className={`${prefixCls2}_dev_header_btn`}
type="primary" type="primary"
shape="round" shape="round"
size="large" size="large"
@ -99,6 +100,7 @@ function Grant(props: GrantProps) {
<div className={`${prefixCls2}_prod`}> <div className={`${prefixCls2}_prod`}>
<div className={`${prefixCls2}_prod_header`}> <div className={`${prefixCls2}_prod_header`}>
<Button <Button
className={`${prefixCls2}_prod_header_btn`}
type="primary" type="primary"
shape="round" shape="round"
size="large" size="large"

View File

@ -306,7 +306,7 @@ function Tencent(props: {
layout="vertical" layout="vertical"
style={{ marginTop: 10 }} style={{ marginTop: 10 }}
> >
{/* <Form.Item <Form.Item
label="secretId" label="secretId"
name="secretId" name="secretId"
> >
@ -323,7 +323,7 @@ function Tencent(props: {
} }
/> />
</> </>
</Form.Item> */} </Form.Item>
<Form.Item <Form.Item
label="smsSdkAppId" label="smsSdkAppId"
name="smsSdkAppId" name="smsSdkAppId"

View File

@ -56,6 +56,7 @@ const locale: LocaleDef<
'', '',
{ {
type: Schema['type']; type: Schema['type'];
qrCodeType: QrCodeType;
} }
> = { > = {
zh_CN: { zh_CN: {
@ -83,6 +84,13 @@ const locale: LocaleDef<
grant: '授予', grant: '授予',
transfer: '转交', transfer: '转交',
}, },
qrCodeType: {
webForWechatPublic: '网站引流到公众号',
wechatMpDomainUrl: '小程序url码',
wechatMpWxaCode: '小程序码',
wechatPublic: '公众号关注码',
wechatPublicForMp: '公众号回复小程序码',
}
}, },
}, },
}; };

View File

@ -63,7 +63,9 @@ const indexes: Index<Schema>[] = [
}, },
]; ];
const locale: LocaleDef<Schema, '', '', {}> = { const locale: LocaleDef<Schema, '', '', {
type: QrCodeType,
}> = {
zh_CN: { zh_CN: {
attr: { attr: {
entity: '关联对象', entity: '关联对象',
@ -80,5 +82,14 @@ const locale: LocaleDef<Schema, '', '', {}> = {
application: '应用', application: '应用',
props: '属性', props: '属性',
}, },
v: {
type: {
webForWechatPublic: '网站引流到公众号',
wechatMpDomainUrl: '小程序url码',
wechatMpWxaCode: '小程序码',
wechatPublic: '公众号关注码',
wechatPublicForMp: '公众号回复小程序码',
}
}
}, },
}; };

View File

@ -2,5 +2,14 @@ import addressTriggers from './address';
import userTriggers from './user'; import userTriggers from './user';
import userEntityGrantTriggers from './userEntityGrant'; import userEntityGrantTriggers from './userEntityGrant';
import wechatQrCodeTriggers from './wechatQrCode'; import wechatQrCodeTriggers from './wechatQrCode';
import messageTriggers from './message';
import notificationTriggers from './notification';
export default [...addressTriggers, ...userTriggers, ...userEntityGrantTriggers, ...wechatQrCodeTriggers]; export default [
...addressTriggers,
...userTriggers,
...userEntityGrantTriggers,
...wechatQrCodeTriggers,
...messageTriggers,
...notificationTriggers,
];

View File

@ -132,10 +132,10 @@ async function createNotification(message: CreateMessageData, context: BRC) {
} }
); );
if (channels.length === 0) { /* if (channels.length === 0) {
console.warn(`类型为${type}的消息在生成时尝试为之生成通知找不到可推送的channel`); console.warn(`类型为${type}的消息在生成时尝试为之生成通知找不到可推送的channel`);
return 0; return 0;
} } */
// 逐system逐channel去构造messageSystem和messageSent数据 // 逐system逐channel去构造messageSystem和messageSent数据
let messageSentCount = 0; let messageSentCount = 0;
@ -267,8 +267,8 @@ async function createNotification(message: CreateMessageData, context: BRC) {
action: 'create', action: 'create',
data: notificationDatas, data: notificationDatas,
}; };
messageSystemDatas.push(messageSystemData);
} }
messageSystemDatas.push(messageSystemData);
} }
) )
); );

View File

@ -43,6 +43,7 @@ const triggers: Trigger<EntityDict, 'userEntityGrant', RuntimeCxt>[] = [
oakId: id, oakId: id,
}, },
}, },
type: userEntityGrantData.qrCodeType,
}, },
context as BackendRuntimeContext<EntityDict> context as BackendRuntimeContext<EntityDict>
); );