|
@@ -20,6 +20,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import config from "@/tenant/config";
|
|
|
+import { navigator, storage, toast } from "@/utils/uniApi";
|
|
|
export default {
|
|
|
name: "detail.vue",
|
|
|
data() {
|
|
@@ -31,6 +33,25 @@ export default {
|
|
|
onLoad(op) {
|
|
|
this.image = op.file;
|
|
|
console.log("接收显示图片url:" + this.image);
|
|
|
+ wx.uploadFile({
|
|
|
+ url: config.host + "/wutong-file/minio/file/upload", // 仅为示例,非真实的接口地址
|
|
|
+ filePath: op.file,
|
|
|
+ header: {
|
|
|
+ "Blade-Auth": "bearer " + storage.get("token"),
|
|
|
+ Authorization: "Basic cHJvamVjdF93eDpwcm9qZWN0X3d4X2tleQ==",
|
|
|
+ },
|
|
|
+ name: "file",
|
|
|
+ success(res) {
|
|
|
+ let backData = JSON.parse(res.data);
|
|
|
+ console.log("上传后返回的信息:" + res.data);
|
|
|
+ },
|
|
|
+ fail(err) {
|
|
|
+ uni.showToast({
|
|
|
+ title: "上传失败",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
againTakePhoto() {
|