{"id":186302,"date":"2022-08-27T08:57:19","date_gmt":"2022-08-27T00:57:19","guid":{"rendered":"http:\/\/www.idc.net\/help\/186302\/"},"modified":"2022-08-27T08:57:19","modified_gmt":"2022-08-27T00:57:19","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91%e7%99%be%e5%ba%a6%e5%b0%8f%e7%a8%8b%e5%ba%8f%e6%95%99%e7%a8%8b%ef%bc%9aswan-sharefile","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/186302\/","title":{"rendered":"\u540e\u6d6a\u4e91\u767e\u5ea6\u5c0f\u7a0b\u5e8f\u6559\u7a0b\uff1aswan.shareFile"},"content":{"rendered":"<ul>\n<li>swan.shareFile\n<ul>\n<li>\u65b9\u6cd5\u53c2\u6570\n<ul>\n<li>data \u53c2\u6570\u8bf4\u660e<\/li>\n<\/ul>\n<\/li>\n<li>\u793a\u4f8b\n<ul>\n<li>\u56fe\u7247\u793a\u4f8b<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b 1\uff1a\u5206\u4eab\u672c\u5730\u6587\u4ef6<\/li>\n<li>\u4ee3\u7801\u793a\u4f8b 2\uff1a\u5206\u4eab\u670d\u52a1\u5668\u4e0a\u6587\u4ef6\n<ul><\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h1><span><\/span>swan.shareFile<\/h1>\n<blockquote>\n<p>\u5728\u5de5\u5177\u548c\u771f\u673a\u4e2d\u7684\u5b9e\u73b0\u6709\u533a\u522b\uff0c\u8be6\u89c1 API \u5b9e\u73b0\u5dee\u5f02\u3002\u57fa\u7840\u5e93 3.80.2 \u5f00\u59cb\u652f\u6301\uff0c\u4f4e\u7248\u672c\u9700\u505a\u517c\u5bb9\u5904\u7406\u3002<\/p>\n<\/blockquote>\n<p><strong>\u89e3\u91ca<\/strong>\uff1a\u652f\u6301\u8c03\u8d77\u7cfb\u7edf\u5206\u4eab\u9762\u677f\u5c06\u6587\u4ef6\u5206\u4eab\u5230\u5176\u4ed6 App\u3002<br \/><strong>Web \u6001\u8bf4\u660e<\/strong>\uff1aWeb \u6001\u5c0f\u7a0b\u5e8f\u6682\u4e0d\u652f\u6301\uff0c\u63a5\u53e3\u8c03\u7528\u4f1a\u8fdb\u5165\u5931\u8d25\u56de\u8c03\uff08fail\uff09\u3002<\/p>\n<h2><span><\/span>\u65b9\u6cd5\u53c2\u6570<\/h2>\n<p>Object object<\/p>\n<h3><span><\/span>data \u53c2\u6570\u8bf4\u660e<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u53c2\u6570\u540d<\/th>\n<th>\u7c7b\u578b<\/th>\n<th>\u662f\u5426\u5fc5\u586b<\/th>\n<th>\u9ed8\u8ba4\u503c<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<p>filePath<\/p>\n<\/td>\n<td>\n<p>String<\/p>\n<\/td>\n<td>\n<p>\u662f<\/p>\n<\/td>\n<td><\/td>\n<td>\n<p>\u9700\u8981\u5206\u4eab\u7684\u6587\u6863\u7684\u5730\u5740<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>success<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<td>\n<p>\u5426<\/p>\n<\/td>\n<td><\/td>\n<td>\n<p>\u63a5\u53e3\u8c03\u7528\u6210\u529f\u7684\u56de\u8c03<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>fail<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<td>\n<p>\u5426<\/p>\n<\/td>\n<td><\/td>\n<td>\n<p>\u63a5\u53e3\u8c03\u7528\u5931\u8d25\u7684\u56de\u8c03\u51fd\u6570<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>complete<\/p>\n<\/td>\n<td>\n<p>Function<\/p>\n<\/td>\n<td>\n<p>\u5426<\/p>\n<\/td>\n<td><\/td>\n<td>\n<p>\u63a5\u53e3\u8c03\u7528\u7ed3\u675f\u7684\u56de\u8c03\u51fd\u6570\uff08\u8c03\u7528\u6210\u529f\u3001\u5931\u8d25\u90fd\u4f1a\u6267\u884c\uff09<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span><\/span>\u793a\u4f8b<\/h2>\n<p>\u626b\u7801\u4f53\u9a8c<\/p>\n<p>\u4ee3\u7801\u793a\u4f8b<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.sitestack.cn\/projects\/smartprogram-20210306\/97ebf63311ffac886baad1c970c1b97b.png\" class=\"aligncenter\"><\/p>\n<p>\u8bf7\u4f7f\u7528\u767e\u5ea6APP\u626b\u7801<\/p>\n<h3><span><\/span>\u56fe\u7247\u793a\u4f8b<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/static.sitestack.cn\/projects\/smartprogram-20210306\/bce723f8de7b8f6dc47c6e7c6d506b3b.gif\" class=\"aligncenter\"><\/p>\n<\/p>\n<h3><span><\/span>\u4ee3\u7801\u793a\u4f8b 1\uff1a\u5206\u4eab\u672c\u5730\u6587\u4ef6<\/h3>\n<p>\u5728\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6253\u5f00<\/p>\n<p>\u5728\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6253\u5f00<\/p>\n<p>\u5728 WEB IDE \u4e2d\u6253\u5f00<\/p>\n<ul>\n<li>SWAN<\/li>\n<li>JS<\/li>\n<\/ul>\n<pre>\n \n \n <ol>\n  \n  \n  <li><code><span>&lt;view<\/span><span> <\/span><span>class<\/span><span>=<\/span><span>\"wrap\"<\/span><span>&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;button<\/span><span> <\/span><span>type<\/span><span>=<\/span><span>\"primary\"<\/span><span> <\/span><span>bindtap<\/span><span>=<\/span><span>\"shareFile\"<\/span><span>&gt;<\/span><span>\u70b9\u51fb\u5206\u4eab\u6587\u4ef6<\/span><span>&lt;\/button&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span>&lt;\/view&gt;<\/span><\/code><\/li>\n \n \n <\/ol><\/pre>\n<h3><span><\/span>\u4ee3\u7801\u793a\u4f8b 2\uff1a\u5206\u4eab\u670d\u52a1\u5668\u4e0a\u6587\u4ef6<\/h3>\n<p>\u5728\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6253\u5f00<\/p>\n<p>\u5728\u5f00\u53d1\u8005\u5de5\u5177\u4e2d\u6253\u5f00<\/p>\n<p>\u5728 WEB IDE \u4e2d\u6253\u5f00<\/p>\n<ul>\n<li>SWAN<\/li>\n<li>JS<\/li>\n<\/ul>\n<pre>\n \n \n <ol>\n  \n  \n  <li><code><span>&lt;view<\/span><span> <\/span><span>class<\/span><span>=<\/span><span>\"wrap\"<\/span><span>&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;view<\/span><span> <\/span><span>class<\/span><span>=<\/span><span>\"card-area\"<\/span><span>&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;view<\/span><span> <\/span><span>class<\/span><span>=<\/span><span>\"display-area\"<\/span><span>&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;image<\/span><span> <\/span><span>class<\/span><span>=<\/span><span>\"file-icon\"<\/span><span> <\/span><span>src<\/span><span>=<\/span><span>\"\/images\/file-pdf.png\"<\/span><span> <\/span><span>mode<\/span><span>=<\/span><span>\"widthFix\"<\/span><span>&gt;&lt;\/image&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;view<\/span><span> <\/span><span>class<\/span><span>=<\/span><span>\"file-label\"<\/span><span>&gt;<\/span><span>\u793a\u4f8b\u6587\u4ef6.pdf<\/span><span>&lt;\/view&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;\/view&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;button<\/span><span> <\/span><span>type<\/span><span>=<\/span><span>\"primary\"<\/span><span> <\/span><span>bindtap<\/span><span>=<\/span><span>\"shareFile\"<\/span><span>&gt;<\/span><span>\u5206\u4eab\u670d\u52a1\u5668\u4e0a\u6587\u4ef6<\/span><span>&lt;\/button&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span> <\/span><span>&lt;\/view&gt;<\/span><\/code><\/li>\n  \n  \n  <li><code><span>&lt;\/view&gt;<\/span><\/code><\/li>\n \n \n <\/ol><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>swan.shareFile \u65b9\u6cd5\u53c2\u6570 data \u53c2\u6570\u8bf4\u660e \u793a\u4f8b \u56fe\u7247\u793a\u4f8b \u4ee3\u7801\u793a\u4f8b 1\uff1a\u5206\u4eab\u672c\u5730\u6587\u4ef6 \u4ee3\u7801\u793a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":186303,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182398],"tags":[],"class_list":["post-186302","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mini-program"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/186302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=186302"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/186302\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/186303"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=186302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=186302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=186302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}