UNPKG

py-uni

Version:

py-uni

42 lines (38 loc) 1.25 kB
// @ts-ignore import baseUrl from '@/config/request.config.json' import {ContentTypes} from "../domain/contentTypes.domain"; export class ContentTypeMgeService { baseUrl: string; constructor() { this.baseUrl = baseUrl.baseUrl + 'ContentTypeMgeSvr.assx/'; } /** * app登录 * @constructor * @param token * @param reppositoryId * @param parentId */ query(token: string, reppositoryId: string, parentId: string): Promise<ContentTypes> { return new Promise((resolve, reject) => { uni.request({ url: this.baseUrl + 'query', data: { token: token, reppositoryId: reppositoryId, parentId: parentId }, method: 'POST', header: { 'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息 }, success: function (res: any) { resolve(new ContentTypes(res.data)); }, fail: function (err) { reject(err); } }) }) } }