build
This commit is contained in:
parent
928c5c5d9c
commit
84a4336a1f
|
|
@ -1,5 +1,5 @@
|
|||
.tabLabel {
|
||||
// writing-mode: vertical-rl;
|
||||
// letter-spacing: .2rem;
|
||||
writing-mode: horizontal-tb;
|
||||
// writing-mode: vertical-rl;
|
||||
// letter-spacing: .2rem;
|
||||
writing-mode: horizontal-tb;
|
||||
}
|
||||
|
|
@ -33,9 +33,9 @@ export default class CTYun {
|
|||
}
|
||||
async upload(extraFile, uploadFn, file) {
|
||||
const uploadMeta = extraFile.uploadMeta;
|
||||
let result;
|
||||
let response;
|
||||
try {
|
||||
result = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
response = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
key: uploadMeta.key,
|
||||
Policy: uploadMeta.policy,
|
||||
AWSAccessKeyId: uploadMeta.accessKey,
|
||||
|
|
@ -48,21 +48,22 @@ export default class CTYun {
|
|||
}
|
||||
let isSuccess = false;
|
||||
if (process.env.OAK_PLATFORM === 'wechatMp') {
|
||||
// 小程序端上传 使用wx.uploadFile
|
||||
if (result.errMsg === 'uploadFile:ok') {
|
||||
const jsonData = JSON.parse(result.data);
|
||||
isSuccess = !!jsonData.key;
|
||||
// 小程序端上传 使用wx.uploadFile
|
||||
// 待测试
|
||||
if (response.errMsg === 'uploadFile:ok') {
|
||||
const data = JSON.parse(response.data);
|
||||
isSuccess = !!(data.status === 204);
|
||||
}
|
||||
}
|
||||
else {
|
||||
isSuccess = !!(result.success === true || result.key);
|
||||
isSuccess = !!(response.status === 204);
|
||||
}
|
||||
// 解析回调
|
||||
if (isSuccess) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
throw new OakUploadException('图片上传七牛失败');
|
||||
throw new OakUploadException('图片上传天翼云失败');
|
||||
}
|
||||
}
|
||||
composeFileUrl(extraFile, context, style) {
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ export default class Qiniu {
|
|||
}
|
||||
async upload(extraFile, uploadFn, file) {
|
||||
const uploadMeta = extraFile.uploadMeta;
|
||||
let result;
|
||||
let response;
|
||||
try {
|
||||
result = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
response = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
key: uploadMeta.key,
|
||||
token: uploadMeta.uploadToken,
|
||||
}, true);
|
||||
|
|
@ -47,13 +47,14 @@ export default class Qiniu {
|
|||
let isSuccess = false;
|
||||
if (process.env.OAK_PLATFORM === 'wechatMp') {
|
||||
// 小程序端上传 使用wx.uploadFile
|
||||
if (result.errMsg === 'uploadFile:ok') {
|
||||
const jsonData = JSON.parse(result.data);
|
||||
isSuccess = !!jsonData.key;
|
||||
if (response.errMsg === 'uploadFile:ok') {
|
||||
const data = JSON.parse(response.data);
|
||||
isSuccess = !!(data.success === true || data.key);
|
||||
}
|
||||
}
|
||||
else {
|
||||
isSuccess = !!(result.success === true || result.key);
|
||||
const data = await response.json();
|
||||
isSuccess = !!(data.success === true || data.key);
|
||||
}
|
||||
// 解析回调
|
||||
if (isSuccess) {
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { BackendRuntimeContext } from '../../context/BackendRuntimeContext';
|
|||
import Sms from "../../types/Sms";
|
||||
import { ED } from '../../types/RuntimeCxt';
|
||||
import { EntityDict } from '../../oak-app-domain';
|
||||
import { AliSmsConfig } from '../../types/Config';
|
||||
export default class Ali implements Sms<ED, BackendRuntimeContext<ED>> {
|
||||
name: string;
|
||||
getConfig(context: BackendRuntimeContext<ED>): any;
|
||||
getConfig(context: BackendRuntimeContext<ED>): AliSmsConfig;
|
||||
syncTemplate(systemId: string): Promise<never[]>;
|
||||
sendSms(params: {
|
||||
mobile: string;
|
||||
|
|
|
|||
|
|
@ -30,13 +30,12 @@ export default class Ali {
|
|||
signName: defaultSignName,
|
||||
});
|
||||
const { code, message, requestId } = result;
|
||||
if (result?.code === 'Ok') {
|
||||
if (code === 'Ok') {
|
||||
return {
|
||||
success: true,
|
||||
res: result,
|
||||
};
|
||||
}
|
||||
console.warn(message);
|
||||
return {
|
||||
success: false,
|
||||
res: result,
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { BackendRuntimeContext } from '../../context/BackendRuntimeContext';
|
|||
import Sms from "../../types/Sms";
|
||||
import { ED } from '../../types/RuntimeCxt';
|
||||
import { EntityDict } from '../../oak-app-domain';
|
||||
import { TencentSmsConfig } from '../../types/Config';
|
||||
export default class Tencent implements Sms<ED, BackendRuntimeContext<ED>> {
|
||||
name: string;
|
||||
getConfig(context: BackendRuntimeContext<ED>, systemId?: string): Promise<any>;
|
||||
getConfig(context: BackendRuntimeContext<ED>, systemId?: string): Promise<TencentSmsConfig>;
|
||||
syncTemplate(systemId: string, context: BackendRuntimeContext<ED>): Promise<{
|
||||
templateCode: string;
|
||||
templateName: string;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ export default class Tencent {
|
|||
TemplateId: templateCode,
|
||||
SignName: defaultSignName,
|
||||
});
|
||||
const code = get(result, 'SendStatusSet.[0].Code', '');
|
||||
const code = result?.SendStatusSet?.[0]?.Code || '';
|
||||
if (code === 'Ok') {
|
||||
return {
|
||||
success: true,
|
||||
|
|
@ -86,7 +86,7 @@ export default class Tencent {
|
|||
};
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
success: false,
|
||||
res: result,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ class CTYun {
|
|||
}
|
||||
async upload(extraFile, uploadFn, file) {
|
||||
const uploadMeta = extraFile.uploadMeta;
|
||||
let result;
|
||||
let response;
|
||||
try {
|
||||
result = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
response = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
key: uploadMeta.key,
|
||||
Policy: uploadMeta.policy,
|
||||
AWSAccessKeyId: uploadMeta.accessKey,
|
||||
|
|
@ -50,21 +50,22 @@ class CTYun {
|
|||
}
|
||||
let isSuccess = false;
|
||||
if (process.env.OAK_PLATFORM === 'wechatMp') {
|
||||
// 小程序端上传 使用wx.uploadFile
|
||||
if (result.errMsg === 'uploadFile:ok') {
|
||||
const jsonData = JSON.parse(result.data);
|
||||
isSuccess = !!jsonData.key;
|
||||
// 小程序端上传 使用wx.uploadFile
|
||||
// 待测试
|
||||
if (response.errMsg === 'uploadFile:ok') {
|
||||
const data = JSON.parse(response.data);
|
||||
isSuccess = !!(data.status === 204);
|
||||
}
|
||||
}
|
||||
else {
|
||||
isSuccess = !!(result.success === true || result.key);
|
||||
isSuccess = !!(response.status === 204);
|
||||
}
|
||||
// 解析回调
|
||||
if (isSuccess) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
throw new Exception_1.OakUploadException('图片上传七牛失败');
|
||||
throw new Exception_1.OakUploadException('图片上传天翼云失败');
|
||||
}
|
||||
}
|
||||
composeFileUrl(extraFile, context, style) {
|
||||
|
|
|
|||
|
|
@ -35,9 +35,9 @@ class Qiniu {
|
|||
}
|
||||
async upload(extraFile, uploadFn, file) {
|
||||
const uploadMeta = extraFile.uploadMeta;
|
||||
let result;
|
||||
let response;
|
||||
try {
|
||||
result = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
response = await uploadFn(file, 'file', uploadMeta.uploadHost, {
|
||||
key: uploadMeta.key,
|
||||
token: uploadMeta.uploadToken,
|
||||
}, true);
|
||||
|
|
@ -49,13 +49,14 @@ class Qiniu {
|
|||
let isSuccess = false;
|
||||
if (process.env.OAK_PLATFORM === 'wechatMp') {
|
||||
// 小程序端上传 使用wx.uploadFile
|
||||
if (result.errMsg === 'uploadFile:ok') {
|
||||
const jsonData = JSON.parse(result.data);
|
||||
isSuccess = !!jsonData.key;
|
||||
if (response.errMsg === 'uploadFile:ok') {
|
||||
const data = JSON.parse(response.data);
|
||||
isSuccess = !!(data.success === true || data.key);
|
||||
}
|
||||
}
|
||||
else {
|
||||
isSuccess = !!(result.success === true || result.key);
|
||||
const data = await response.json();
|
||||
isSuccess = !!(data.success === true || data.key);
|
||||
}
|
||||
// 解析回调
|
||||
if (isSuccess) {
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { BackendRuntimeContext } from '../../context/BackendRuntimeContext';
|
|||
import Sms from "../../types/Sms";
|
||||
import { ED } from '../../types/RuntimeCxt';
|
||||
import { EntityDict } from '../../oak-app-domain';
|
||||
import { AliSmsConfig } from '../../types/Config';
|
||||
export default class Ali implements Sms<ED, BackendRuntimeContext<ED>> {
|
||||
name: string;
|
||||
getConfig(context: BackendRuntimeContext<ED>): any;
|
||||
getConfig(context: BackendRuntimeContext<ED>): AliSmsConfig;
|
||||
syncTemplate(systemId: string): Promise<never[]>;
|
||||
sendSms(params: {
|
||||
mobile: string;
|
||||
|
|
|
|||
|
|
@ -33,13 +33,12 @@ class Ali {
|
|||
signName: defaultSignName,
|
||||
});
|
||||
const { code, message, requestId } = result;
|
||||
if (result?.code === 'Ok') {
|
||||
if (code === 'Ok') {
|
||||
return {
|
||||
success: true,
|
||||
res: result,
|
||||
};
|
||||
}
|
||||
console.warn(message);
|
||||
return {
|
||||
success: false,
|
||||
res: result,
|
||||
|
|
|
|||
|
|
@ -2,9 +2,10 @@ import { BackendRuntimeContext } from '../../context/BackendRuntimeContext';
|
|||
import Sms from "../../types/Sms";
|
||||
import { ED } from '../../types/RuntimeCxt';
|
||||
import { EntityDict } from '../../oak-app-domain';
|
||||
import { TencentSmsConfig } from '../../types/Config';
|
||||
export default class Tencent implements Sms<ED, BackendRuntimeContext<ED>> {
|
||||
name: string;
|
||||
getConfig(context: BackendRuntimeContext<ED>, systemId?: string): Promise<any>;
|
||||
getConfig(context: BackendRuntimeContext<ED>, systemId?: string): Promise<TencentSmsConfig>;
|
||||
syncTemplate(systemId: string, context: BackendRuntimeContext<ED>): Promise<{
|
||||
templateCode: string;
|
||||
templateName: string;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class Tencent {
|
|||
TemplateId: templateCode,
|
||||
SignName: defaultSignName,
|
||||
});
|
||||
const code = (0, lodash_1.get)(result, 'SendStatusSet.[0].Code', '');
|
||||
const code = result?.SendStatusSet?.[0]?.Code || '';
|
||||
if (code === 'Ok') {
|
||||
return {
|
||||
success: true,
|
||||
|
|
@ -89,7 +89,7 @@ class Tencent {
|
|||
};
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
success: false,
|
||||
res: result,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue