无码日韩精品一区二区三区浪潮_99国产精品久久久久9999高清_亚洲熟妇无码久久观看_亚洲a∨无码一区二区猫咪

微信掃碼登錄

其他登錄方式

綁定手機(jī)號

注冊

忘記密碼

用戶協(xié)議

綁定手機(jī)號

近期有不法分子打著愛盈利的旗號,制作“愛盈利”名稱的App,并偽造愛盈利證件,騙取用戶信任,以抖音點贊賺錢或其他方式賺錢為名義,過程中以升級會員獲得高傭金為名讓用戶充值。
愛盈利公司鄭重聲明:我司沒有研發(fā)或運(yùn)營過任何名為“愛盈利”的APP,我司做任務(wù)賺錢類產(chǎn)品從沒有讓任何普通用戶充值升級會員。我公司產(chǎn)品均在本網(wǎng)站可查詢,請將網(wǎng)站拉至底部,點擊“關(guān)于我們”可查看愛盈利相關(guān)產(chǎn)品與服務(wù)。
溫馨提示:當(dāng)遇到此類問題請撥打官方電話或添加官方微信,以免財產(chǎn)損失。愛盈利官網(wǎng)地址:www.jza6.com。
  • 推廣與合作
X

小程序丨微信小程序從后面服務(wù)端獲取數(shù)據(jù)失敗

來源: 9119

本人新人,剛剛上手小程序幾天,希望各位大神多多指教
1、后端采用的是asp.net(VB.NET),創(chuàng)建的是webservice,部分代碼如下

<WebMethod()> _
    Public Sub GetStudentEx(ID As Integer)
        Dim stu As New Student
        Dim stuJsonString As String
        If ID = 1 Then
            stu.ID = 1
            stu.Name = "Byron"
        Else
            stu.ID = 2
            stu.Name = "Frank"
        End If
        stuJsonString = JsonConvert.SerializeObject(stu)
        '主要是下面的兩句
        Context.Response.Write(stuJsonString)
        Context.Response.End()
    End Sub
 
    <WebMethod()> _
    Public Function GetStudentExEx(ID As Integer) As String
        Dim stu As New Student
        Dim stuJsonString As String
        If ID = 1 Then
            stu.ID = 1
            stu.Name = "Byron"
        Else
            stu.ID = 2
            stu.Name = "Frank"
        End If
        stuJsonString = JsonConvert.SerializeObject(stu)
        Return stuJsonString
 
    End Function

2、微信小程序編寫的js文件中的代碼如下:

Page({
  data: {
  },
  onLoad: function () {
    wx.request({
            method:"POST",
            url:"http://127.0.0.1/WebService.asmx/GetStudentEx",
            data: {
              ID:2
            },
            header: {
                'Content-Type': 'application/json'
            },
            success:function(res){
                  console.log('正確在這里');
                  console.log(res.data);
                  console.log(res.data.d);
                  console.log(res.data.Student.ID);
            },
             fail: function (res) {
                console.log('錯誤在這里');
            }
         })  
  }
})

3、我是在自己電腦上模擬的,在調(diào)用后端方法“GetStudentExEx”的時候,url:"http://127.0.0.1/WebService.asmx/GetStudentExEx",是沒有問題的,可以成功獲取到值

微信小程序從后面服務(wù)端獲取數(shù)據(jù)失敗

4、但是在調(diào)用"GetStudentEx"的時候,發(fā)現(xiàn)調(diào)用不成功,提示錯誤

微信小程序從后面服務(wù)端獲取數(shù)據(jù)失敗

網(wǎng)友回復(fù):

A***:

每個微信小程序需要事先設(shè)置一個通訊域名,小程序可以跟指定的域名與進(jìn)行網(wǎng)絡(luò)通信。

東***:

也就是說,每個小程序必須與域名綁定對不?

湯***:

問題已經(jīng)找到,是“Context.Response.End()”這句話引起的

導(dǎo)致傳輸數(shù)據(jù)流中斷。把這句話去掉就可以了

愛盈利(aiyingli.com)移動互聯(lián)網(wǎng)最具影響力的盈利指導(dǎo)網(wǎng)站。定位于服務(wù)移動互聯(lián)網(wǎng)創(chuàng)業(yè)者,移動盈利指導(dǎo)。我們的目標(biāo)是讓盈利目標(biāo)清晰可見!降低門檻,讓缺乏經(jīng)驗、資金有限的個人和團(tuán)隊獲得經(jīng)驗和機(jī)會,提高熱情,激發(fā)產(chǎn)品。

評論

相關(guān)文章推薦

SELECT dw_posts.ID,dw_posts.post_title,dw_posts.post_content FROM dw_posts INNER JOIN dw_term_relationships ON (dw_posts.ID = dw_term_relationships.object_id) WHERE 1=1 AND(dw_term_relationships.term_taxonomy_id = 5246 ) AND dw_posts.post_type = 'post' AND (dw_posts.post_status = 'publish') GROUP BY dw_posts.ID ORDER BY RAND() LIMIT 0, 6

京ICP備15063977號-2 ? 2012-2018 aiyingli.com. All Rights Reserved. 京公網(wǎng)安備 11010102003938號