|
@@ -10,6 +10,7 @@
|
|
|
<nut-button type="primary" @click="login()">登录</nut-button>
|
|
<nut-button type="primary" @click="login()">登录</nut-button>
|
|
|
<nut-button type="primary" @click="upload()">上传文件</nut-button>
|
|
<nut-button type="primary" @click="upload()">上传文件</nut-button>
|
|
|
<nut-button type="primary" @click="download()">下载文件</nut-button>
|
|
<nut-button type="primary" @click="download()">下载文件</nut-button>
|
|
|
|
|
+ <nut-button type="primary" @click="http()">http封装</nut-button>
|
|
|
</view>
|
|
</view>
|
|
|
<nut-toast :msg="msg2" v-model:visible="show" :type="type" :cover="cover" />
|
|
<nut-toast :msg="msg2" v-model:visible="show" :type="type" :cover="cover" />
|
|
|
</view>
|
|
</view>
|
|
@@ -20,6 +21,8 @@
|
|
|
import Taro from '@tarojs/taro';
|
|
import Taro from '@tarojs/taro';
|
|
|
import { reactive, toRefs } from 'vue';
|
|
import { reactive, toRefs } from 'vue';
|
|
|
import { Dongdong } from '@nutui/icons-vue-taro';
|
|
import { Dongdong } from '@nutui/icons-vue-taro';
|
|
|
|
|
+import httpClient from '../../core/http';
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
name: 'Index',
|
|
name: 'Index',
|
|
|
components: {
|
|
components: {
|
|
@@ -130,8 +133,20 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ const http = () => {
|
|
|
|
|
+ httpClient({
|
|
|
|
|
+ url: "/oss/test",
|
|
|
|
|
+ method: "GET",
|
|
|
|
|
+ data: {},
|
|
|
|
|
+ success(result: string) {
|
|
|
|
|
+ console.log("成功啦", result);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return {
|
|
return {
|
|
|
- ...toRefs(state), handleClick, login, upload, download
|
|
|
|
|
|
|
+ ...toRefs(state), handleClick, login, upload, download, http
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|