createMaterial 添加appType

This commit is contained in:
qsc 2023-10-12 17:15:07 +08:00
parent eda8081ecf
commit 7256c92b0b
6 changed files with 6 additions and 3 deletions

View File

@ -83,7 +83,7 @@ export default OakComponent({
async upload(media, description) {
const { applicationId } = this.props;
const { type } = this.props;
const result = await this.features.wechatMenu.createMaterial({ applicationId: applicationId, type: type, file: media, description, isPermanent: true });
const result = await this.features.wechatMenu.createMaterial({ appType: 'wechatPublic', applicationId: applicationId, type: type, file: media, description, isPermanent: true });
if (result && result.mediaId) {
this.setMessage({
type: 'success',

View File

@ -45,6 +45,7 @@ export declare class WechatMenu<ED extends EntityDict, Cxt extends BackendRuntim
articleId: string;
}): Promise<ReturnType<(AD & CommonAspectDict<ED, Cxt>)["getArticle"]>>;
createMaterial(params: {
appType: string;
applicationId: string;
type: MediaType;
file: File;

View File

@ -85,7 +85,7 @@ exports.default = OakComponent({
async upload(media, description) {
const { applicationId } = this.props;
const { type } = this.props;
const result = await this.features.wechatMenu.createMaterial({ applicationId: applicationId, type: type, file: media, description, isPermanent: true });
const result = await this.features.wechatMenu.createMaterial({ appType: 'wechatPublic', applicationId: applicationId, type: type, file: media, description, isPermanent: true });
if (result && result.mediaId) {
this.setMessage({
type: 'success',

View File

@ -45,6 +45,7 @@ export declare class WechatMenu<ED extends EntityDict, Cxt extends BackendRuntim
articleId: string;
}): Promise<ReturnType<(AD & CommonAspectDict<ED, Cxt>)["getArticle"]>>;
createMaterial(params: {
appType: string;
applicationId: string;
type: MediaType;
file: File;

View File

@ -86,7 +86,7 @@ export default OakComponent({
async upload(media: File, description?: MediaVideoDescription) {
const { applicationId } = this.props;
const { type } = this.props;
const result = await this.features.wechatMenu.createMaterial({ applicationId: applicationId!, type: type as 'image' | 'voice' | 'video', file: media, description, isPermanent: true });
const result = await this.features.wechatMenu.createMaterial({appType: 'wechatPublic', applicationId: applicationId!, type: type as 'image' | 'voice' | 'video', file: media, description, isPermanent: true });
if (result && result.mediaId) {
this.setMessage({
type: 'success',

View File

@ -95,6 +95,7 @@ export class WechatMenu<
}
async createMaterial(params: {
appType: string,
applicationId: string,
type: MediaType,
file: File,