|
|
@@ -0,0 +1,75 @@
|
|
|
+<template>
|
|
|
+ <div class="guide-title">2.4接口调用</div>
|
|
|
+ <div class="guide-body">
|
|
|
+ <!-- <p>服务中心的核心价值在于通过自身服务和第三方应用的互利互惠,提高用户对应用和平台的整体体验和粘度。
|
|
|
+ 平台的开放化使得资源汇聚,让平台运营 方本身保持了自己的优势;开放平台也提供了全新的推广渠道、商业模式与海量客户源,
|
|
|
+ 从而也为平台上的应用提供商带来了价值倍增的全新空间。</p> -->
|
|
|
+
|
|
|
+ <div class="guide-desc-title" id="1.2.1">2.4.1接口的调用</div>
|
|
|
+ <p>
|
|
|
+ (1)、进入我的申请查看接口状态,当显示接口已通过时,证明接口申请通过,可以点击资源名称进入
|
|
|
+ 接口详细页面,查询总接口地址、分页接口地址等接口信息,如图2.4.1所示:
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ (2)、接口的详情页会提供接口的调用样例,如图2.4.2所示,调用接口时需要在样例前加上当前平台url地址,
|
|
|
+ 并附上token,才能正确调用接口,返回对应的数据,同时平台为了安全,也会对接口的调用做一定的限制。
|
|
|
+ </p>
|
|
|
+ <p>
|
|
|
+ (3)、token获取,请求<br/>
|
|
|
+ {{
|
|
|
+ tokenUrl +
|
|
|
+ "?appId='应用ID'&secret='应用secret'"
|
|
|
+ }}
|
|
|
+ <br/>附上申请对应的appId,appSecret。获取token,默认有效期1天。
|
|
|
+ </p>
|
|
|
+ <img class="guide_pic" style="height: 130px" :src="imgUrls[0]"/>
|
|
|
+ <p style="text-align: center">(图 2.4.1)</p>
|
|
|
+ <img class="guide_pic" style="height: 450px" :src="imgUrls[1]"/>
|
|
|
+ <p style="text-align: center; margin-bottom: 20px">(图 2.4.2)</p>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {defineComponent, reactive, ref} from 'vue'
|
|
|
+
|
|
|
+export default defineComponent({
|
|
|
+ setup() {
|
|
|
+ const imgUrls = reactive([
|
|
|
+ import.meta.env.VITE_APP_BASE_API + '/profile/upload/file/dc_241.png',
|
|
|
+ import.meta.env.VITE_APP_BASE_API + '/profile/upload/file/dc_242.png',
|
|
|
+ ])
|
|
|
+ let tokenUrl = ref(window.location.origin + import.meta.env.VITE_APP_BASE_API + '/oauth/token')
|
|
|
+ // getTokenUrl().then((r) => {
|
|
|
+ // tokenUrl.value = r
|
|
|
+ // })
|
|
|
+
|
|
|
+ return {imgUrls, tokenUrl}
|
|
|
+ },
|
|
|
+})
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.guide-title {
|
|
|
+ padding: 15px 0 0;
|
|
|
+ margin: 0 20px;
|
|
|
+ line-height: 35px;
|
|
|
+ font-size: 17px;
|
|
|
+ font-weight: 400;
|
|
|
+ font-style: normal;
|
|
|
+ border-bottom: 1px solid #cccccc;
|
|
|
+}
|
|
|
+
|
|
|
+.guide-body {
|
|
|
+ margin: 0 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.guide-body p {
|
|
|
+ line-height: 36px;
|
|
|
+}
|
|
|
+
|
|
|
+.guide-desc-title {
|
|
|
+ width: 100%;
|
|
|
+ margin: 15px 0 10px;
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 700;
|
|
|
+}
|
|
|
+</style>
|