免费接口 一键生成藏头、藏尾、藏中诗 可押韵 娱乐API!
1.登录ISAS | 起零API数据服务平台 - 免费数据接口 注册账号!
2.登录控制台,右上角--获取API的TOKEN密钥
废话不多说 直接上代码!(代码可直接搬走,记得改下token)
<template>
<view class="content">
<input type="text" class="inp" v-model="keywords" style="border-radius: 35rpx;"/>
<view class="shiwen" v-for="(item,index) in gushiList" :key="index">
<text>{{item.list}}</text>
</view>
<button style="background-color: aqua;" @click="startopcity">点击生成</button>
</view>
</template>
<script>
export default {
data(){
return {
keywords:'',
gushiList:[]
}
},
onLoad() {
},
methods:{
startopcity(){
var self=this;
uni.request({
url:'https://api.istero.com/resource/acrostic/create',
data: {
keywords:this.keywords,
token:"fa7ddbc7e36a9d6f823717a6b9a8ce19"
},
method: 'GET',
header: {
'content-type': 'application/x-www-form-urlencoded',
},
success: (res) => {
var gushiList = this.gushiList;
console.log(res.data.data);
this.gushiList = res.data.data;
},fail: (e) => {
console.log(e);
}
});
console.log(this.keywords);
}
}
}
</script>
<style lang="scss" scoped>
.content{
.inp{
background-color: aliceblue;
height: 80rpx;
width: 60%;
margin: 0 auto;
border: 1rpx solid #cecece;
color: #000000;
}
}
</style>