qukaidi 4 年之前
父节点
当前提交
e2f860c2ab
共有 2 个文件被更改,包括 17 次插入1 次删除
  1. 1 1
      common/request/request.js
  2. 16 0
      pages/home/index.vue

+ 1 - 1
common/request/request.js

@@ -17,7 +17,7 @@ import axios from 'axios'
 
 
 export function request(config) {
 export function request(config) {
     let newVar = axios.create({
     let newVar = axios.create({
-         baseURL: "http://192.168.237.6:9002",
+        baseURL: "http://b2bcnapi.sailuntire.com/allstell/test/app",
         timeout: 10000
         timeout: 10000
     });
     });
     return newVar(config);
     return newVar(config);

+ 16 - 0
pages/home/index.vue

@@ -31,9 +31,13 @@
 					 @click="inIntegral"></u-image>
 					 @click="inIntegral"></u-image>
 				</view>
 				</view>
 			</view>
 			</view>
+			<view class="" @click="ceshi">
+				测试接口是否连接
+			</view>
 			<view class="u-flex u-row-center u-m-t-30">
 			<view class="u-flex u-row-center u-m-t-30">
 				<u-image width="680rpx" src="../../static/sailun/88reward.png" mode="widthFix"></u-image>
 				<u-image width="680rpx" src="../../static/sailun/88reward.png" mode="widthFix"></u-image>
 			</view>
 			</view>
+		
 		</view>
 		</view>
 		<!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
 		<!-- 与包裹页面所有内容的元素u-page同级,且在它的下方 -->
 		<!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
 		<!-- <u-tabbar v-model="current" :list="list"></u-tabbar> -->
@@ -41,6 +45,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	import {request} from '../../common/request/request'
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
@@ -58,6 +63,17 @@
 			};
 			};
 		},
 		},
 		methods: {
 		methods: {
+			ceshi(){
+				request({
+				    url: '/homepage/getBanners',
+				}).then(res => {
+				    console.log(res)
+				}).catch(err => {
+				    console.log(err)
+				}).finally(() => {
+				    Loading.close()
+				})
+			},
 			scancodeIn() {
 			scancodeIn() {
 				this.$u.route({
 				this.$u.route({
 					url: 'pages/home/scancode/index',
 					url: 'pages/home/scancode/index',