createMaterial 添加appType
This commit is contained in:
parent
eda8081ecf
commit
7256c92b0b
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ export class WechatMenu<
|
|||
}
|
||||
|
||||
async createMaterial(params: {
|
||||
appType: string,
|
||||
applicationId: string,
|
||||
type: MediaType,
|
||||
file: File,
|
||||
|
|
|
|||
Loading…
Reference in New Issue