Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
b8557693
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
b8557693
编写于
9月 25, 2023
作者:
taohebin@dcloud.io
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 补充部分ext-api的自动化测试
上级
8f325407
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
679 addition
and
225 deletion
+679
-225
pages/API/download-file/download-file.test.js
pages/API/download-file/download-file.test.js
+18
-0
pages/API/download-file/download-file.uvue
pages/API/download-file/download-file.uvue
+16
-2
pages/API/get-app-authorize-setting/get-app-authorize-setting.test.js
...t-app-authorize-setting/get-app-authorize-setting.test.js
+34
-0
pages/API/get-app-base-info/get-app-base-info.test.js
pages/API/get-app-base-info/get-app-base-info.test.js
+31
-0
pages/API/get-device-info/get-device-info.test.js
pages/API/get-device-info/get-device-info.test.js
+28
-0
pages/API/get-network-type/get-network-type.test.js
pages/API/get-network-type/get-network-type.test.js
+18
-0
pages/API/get-network-type/get-network-type.uvue
pages/API/get-network-type/get-network-type.uvue
+15
-2
pages/API/get-system-info/get-system-info.test.js
pages/API/get-system-info/get-system-info.test.js
+40
-0
pages/API/get-system-info/get-system-info.uvue
pages/API/get-system-info/get-system-info.uvue
+5
-1
pages/API/get-system-setting/get-system-setting.test.js
pages/API/get-system-setting/get-system-setting.test.js
+32
-0
pages/API/get-window-info/get-window-info.test.js
pages/API/get-window-info/get-window-info.test.js
+28
-0
pages/API/get-window-info/get-window-info.uvue
pages/API/get-window-info/get-window-info.uvue
+5
-1
pages/API/request/request.test.js
pages/API/request/request.test.js
+79
-0
pages/API/request/request.uvue
pages/API/request/request.uvue
+235
-213
pages/API/upload-file/upload-file.test.js
pages/API/upload-file/upload-file.test.js
+18
-0
pages/API/upload-file/upload-file.uvue
pages/API/upload-file/upload-file.uvue
+23
-3
pages/API/websocket-socketTask/websocket-socketTask.test.js
pages/API/websocket-socketTask/websocket-socketTask.test.js
+18
-0
pages/API/websocket-socketTask/websocket-socketTask.uvue
pages/API/websocket-socketTask/websocket-socketTask.uvue
+36
-3
未找到文件。
pages/API/download-file/download-file.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/download-file/download-file
'
describe
(
'
ExtApi-DownloadFile
'
,
()
=>
{
let
page
;
let
res
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
await
page
.
callMethod
(
'
jest_downloadFile
'
);
await
page
.
waitFor
(
500
);
res
=
await
page
.
data
(
'
jest_result
'
);
});
it
(
'
Check
'
,
async
()
=>
{
expect
(
res
).
toBe
(
true
);
});
});
pages/API/download-file/download-file.uvue
浏览文件 @
b8557693
...
...
@@ -27,7 +27,9 @@ export default {
title: 'downloadFile',
imageSrc: '',
task: null as DownloadTask | null,
pageVisible: false
pageVisible: false,
//自动化测试例专用
jest_result: false
}
},
onLoad() {
...
...
@@ -66,6 +68,18 @@ export default {
console.log("progress : ", update.progress);
}
})
},
//自动化测试例专用
jest_downloadFile(){
uni.downloadFile({
url: "https://web-assets.dcloud.net.cn/unidoc/zh/uni-app.png",
success() {
this.jest_result = true
},
fail: () => {
this.jest_result = false
}
});
}
}
}
...
...
pages/API/get-app-authorize-setting/get-app-authorize-setting.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/get-app-authorize-setting/get-app-authorize-setting
'
describe
(
'
ExtApi-GetAppAuthorizeSetting
'
,
()
=>
{
let
page
;
let
res
;
let
commonSupportList
=
[
'
authorized
'
,
'
denied
'
,
'
not determined
'
,
'
config error
'
]
let
locationAccuracySupportList
=
[
'
reduced
'
,
'
full
'
,
'
unsupported
'
]
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
res
=
await
uni
.
getAppAuthorizeSetting
();
});
it
(
'
Check cameraAuthorized
'
,
async
()
=>
{
expect
(
commonSupportList
).
toContain
(
res
.
cameraAuthorized
)
});
it
(
'
Check locationAuthorized
'
,
async
()
=>
{
expect
(
commonSupportList
).
toContain
(
res
.
locationAuthorized
)
});
it
(
'
Check locationAccuracy
'
,
async
()
=>
{
expect
(
locationAccuracySupportList
).
toContain
(
res
.
locationAccuracy
)
});
it
(
'
Check microphoneAuthorized
'
,
async
()
=>
{
expect
(
commonSupportList
).
toContain
(
res
.
microphoneAuthorized
)
});
it
(
'
Check notificationAuthorized
'
,
async
()
=>
{
expect
(
commonSupportList
).
toContain
(
res
.
notificationAuthorized
)
});
});
pages/API/get-app-base-info/get-app-base-info.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/get-app-base-info/get-app-base-info
'
describe
(
'
ExtApi-GetAppBaseInfo
'
,
()
=>
{
let
page
;
let
res
;
const
stringProperties
=
[
'
appId
'
,
'
appName
'
,
'
appVersion
'
,
'
appVersionCode
'
,
'
appLanguage
'
,
'
language
'
,
'
version
'
,
'
uniCompileVersion
'
,
'
uniPlatform
'
,
'
uniRuntimeVersion
'
,
]
const
numberProperties
=
[
'
uniCompileVersionCode
'
,
'
uniRuntimeVersionCode
'
]
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
res
=
await
uni
.
getAppBaseInfo
();
});
it
(
'
Check properties
'
,
async
()
=>
{
for
(
const
key
in
res
)
{
const
value
=
res
[
key
];
expect
(
value
).
not
.
toBeNull
();
if
(
stringProperties
.
indexOf
(
key
)
!=
-
1
)
{
expect
(
value
).
not
.
toBe
(
""
);
}
if
(
numberProperties
.
indexOf
(
key
)
!=
-
1
)
{
expect
(
value
).
toBeGreaterThanOrEqual
(
3.90
);
}
}
});
});
pages/API/get-device-info/get-device-info.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/get-device-info/get-device-info
'
describe
(
'
ExtApi-GetDeviceInfo
'
,
()
=>
{
let
page
;
let
res
;
const
stringProperties
=
[
'
brand
'
,
'
deviceBrand
'
,
'
deviceId
'
,
'
model
'
,
'
deviceModel
'
,
'
deviceType
'
,
'
devicePixelRatio
'
,
'
system
'
,
'
platform
'
,
'
uniRuntimeVersion
'
,
]
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
res
=
await
uni
.
getDeviceInfo
();
});
it
(
'
Check properties
'
,
async
()
=>
{
for
(
const
key
in
res
)
{
const
value
=
res
[
key
];
expect
(
value
).
not
.
toBeNull
();
if
(
stringProperties
.
indexOf
(
key
)
!=
-
1
)
{
expect
(
value
).
not
.
toBe
(
""
);
}
if
(
key
==
'
deviceOrientation
'
)
{
expect
([
'
portrait
'
,
'
landscape
'
]).
toContain
(
value
);
}
}
});
});
pages/API/get-network-type/get-network-type.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/get-network-type/get-network-type
'
describe
(
'
ExtApi-GetNetworkType
'
,
()
=>
{
let
page
;
let
res
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
await
page
.
callMethod
(
'
jest_getNetworkType
'
);
await
page
.
waitFor
(
200
);
res
=
await
page
.
data
(
'
jest_result
'
);
});
it
(
'
Check
'
,
async
()
=>
{
expect
(
res
).
toBe
(
true
);
});
});
pages/API/get-network-type/get-network-type.uvue
浏览文件 @
b8557693
...
...
@@ -27,7 +27,9 @@
hasNetworkType: false,
networkType: '',
connectedWifi: '',
pageVisible: false
pageVisible: false,
//自动化测试例专用
jest_result:false,
}
},
onLoad() {
...
...
@@ -61,6 +63,17 @@
this.networkType = '';
this.connectedWifi = '';
},
//自动化测试例专用
jest_getNetworkType(){
uni.getNetworkType({
success: () => {
this.jest_result = true;
},
fail: () => {
this.jest_result = false;
}
})
}
}
}
</script>
...
...
pages/API/get-system-info/get-system-info.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/get-system-info/get-system-info
'
describe
(
'
ExtApi-GetSystemInfo
'
,
()
=>
{
let
page
;
let
res
;
const
stringProperties
=
[
'
appId
'
,
'
appLanguage
'
,
'
appName
'
,
'
appVersion
'
,
'
appVersionCode
'
,
'
brand
'
,
'
deviceId
'
,
'
deviceBrand
'
,
'
deviceModel
'
,
'
deviceType
'
,
'
language
'
,
'
model
'
,
'
version
'
,
'
osName
'
,
'
osVersion
'
,
'
osLanguage
'
,
'
platform
'
,
'
system
'
,
'
ua
'
,
'
uniCompileVersion
'
,
'
uniPlatform
'
,
'
uniRuntimeVersion
'
,
'
romName
'
,
'
romVersion
'
,
]
const
numberProperties
=
[
'
osAndroidAPILevel
'
,
'
devicePixelRatio
'
,
'
pixelRatio
'
,
'
screenWidth
'
,
'
screenHeight
'
,
'
statusBarHeight
'
,
'
windowWidth
'
,
'
windowHeight
'
,
'
windowTop
'
,
'
windowBottom
'
,
'
screenTop
'
,
'
uniCompileVersionCode
'
,
'
uniRuntimeVersionCode
'
]
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
res
=
await
page
.
callMethod
(
'
jest_getSystemInfo
'
)
});
it
(
'
Check GetSystemInfoSync
'
,
async
()
=>
{
for
(
const
key
in
res
)
{
const
value
=
res
[
key
];
expect
(
value
).
not
.
toBeNull
();
if
(
stringProperties
.
indexOf
(
key
)
!=
-
1
)
{
expect
(
value
).
not
.
toBe
(
""
);
}
if
(
numberProperties
.
indexOf
(
key
)
!=
-
1
)
{
expect
(
value
).
toBeGreaterThanOrEqual
(
0
);
}
if
(
key
==
'
deviceOrientation
'
)
{
expect
([
'
portrait
'
,
'
landscape
'
]).
toContain
(
value
);
}
}
});
});
\ No newline at end of file
pages/API/get-system-info/get-system-info.uvue
浏览文件 @
b8557693
...
...
@@ -69,7 +69,11 @@ export default {
}
},
})
}
},
//自动化测试例专用
jest_getSystemInfo():GetSystemInfoResult{
return uni.getSystemInfoSync();
},
}
}
</script>
...
...
pages/API/get-system-setting/get-system-setting.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/get-system-setting/get-system-setting
'
describe
(
'
ExtApi-GetSystemSetting
'
,
()
=>
{
let
page
;
let
res
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
res
=
await
uni
.
getSystemSetting
()
});
it
(
'
Check GetSystemSetting
'
,
async
()
=>
{
for
(
const
key
in
res
)
{
const
value
=
res
[
key
];
if
(
res
[
'
bluetoothEnabled
'
]
==
undefined
)
{
expect
(
res
[
'
bluetoothError
'
]).
not
.
toBe
(
""
)
}
else
{
expect
(
res
[
'
bluetoothError
'
]
==
undefined
).
toBe
(
true
)
}
if
(
res
[
'
wifiEnabled
'
]
==
undefined
)
{
expect
(
res
[
'
wifiError
'
]).
not
.
toBe
(
""
)
}
else
{
expect
(
res
[
'
wifiError
'
]
==
undefined
).
toBe
(
true
)
}
if
(
key
==
'
deviceOrientation
'
)
{
expect
([
'
portrait
'
,
'
landscape
'
]).
toContain
(
value
);
}
}
});
});
pages/API/get-window-info/get-window-info.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/get-window-info/get-window-info
'
describe
(
'
ExtApi-GetWindowInfo
'
,
()
=>
{
let
page
;
let
res
;
const
numberProperties
=
[
'
pixelRatio
'
,
'
screenWidth
'
,
'
screenHeight
'
,
'
statusBarHeight
'
,
'
windowWidth
'
,
'
windowHeight
'
,
'
windowTop
'
,
'
windowBottom
'
,
'
screenTop
'
]
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
res
=
await
page
.
callMethod
(
'
jest_getWindowInfo
'
)
});
it
(
'
Check GetWindowInfo
'
,
async
()
=>
{
for
(
const
key
in
res
)
{
const
value
=
res
[
key
];
expect
(
value
).
not
.
toBeNull
();
if
(
numberProperties
.
indexOf
(
key
)
!=
-
1
)
{
expect
(
value
).
toBeGreaterThanOrEqual
(
0
);
}
}
});
});
pages/API/get-window-info/get-window-info.uvue
浏览文件 @
b8557693
...
...
@@ -47,7 +47,11 @@
this.items.push(item);
}
}
}
},
//自动化测试例专用
jest_getWindowInfo():GetWindowInfoResult{
return uni.getWindowInfo();
},
}
}
</script>
...
...
pages/API/request/request.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/request/request
'
const
methodMap
=
{
"
GET
"
:
"
/api/http/method/get
"
,
"
POST
"
:
"
/api/http/method/post
"
,
"
PUT
"
:
"
/api/http/method/put
"
,
"
DELETE
"
:
"
/api/http/method/delete
"
,
"
PATCH
"
:
"
/api/http/method/patch
"
,
"
OPTIONS
"
:
"
/api/http/method/options
"
,
"
HEAD
"
:
"
/api/http/method/head
"
}
async
function
request
(
page
,
method
,
header
,
data
,
url
)
{
if
(
url
==
null
)
{
url
=
methodMap
[
method
]
}
await
page
.
setData
({
url
:
url
,
method
:
method
,
data
:
data
,
header
:
header
})
res
=
await
page
.
callMethod
(
'
jest_request
'
)
await
page
.
waitFor
(
200
);
res
=
await
page
.
data
(
'
jest_result
'
);
expect
(
res
).
toBe
(
true
)
}
describe
(
'
ExtApi-Request
'
,
()
=>
{
let
page
;
let
res
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
});
beforeEach
(
async
()
=>
{
await
page
.
setData
({
jest_result
:
false
,
data
:
null
,
header
:
null
})
});
it
(
'
Check GET
'
,
async
()
=>
{
await
request
(
page
,
'
GET
'
);
});
it
(
'
Check POST ContentType Json
'
,
async
()
=>
{
await
request
(
page
,
'
POST
'
,
{
"
Content-Type
"
:
"
application/json
"
},
{
"
hello
"
:
"
world
"
},
"
/api/http/contentType/json
"
);
});
it
(
'
Check POST ContentType Form
'
,
async
()
=>
{
await
request
(
page
,
'
POST
'
,
{
"
Content-Type
"
:
"
application/x-www-form-urlencoded
"
},
"
hello=world
"
,
"
/api/http/contentType/xWwwFormUrlencoded
"
);
});
it
(
'
Check PUT
'
,
async
()
=>
{
await
request
(
page
,
'
PUT
'
);
});
it
(
'
Check DELETE
'
,
async
()
=>
{
await
request
(
page
,
'
DELETE
'
);
});
it
(
'
Check PATCH
'
,
async
()
=>
{
await
request
(
page
,
'
PATCH
'
);
});
it
(
'
Check OPTIONS
'
,
async
()
=>
{
await
request
(
page
,
'
OPTIONS
'
);
});
it
(
'
Check HEAD
'
,
async
()
=>
{
await
request
(
page
,
'
HEAD
'
);
});
});
pages/API/request/request.uvue
浏览文件 @
b8557693
...
...
@@ -29,24 +29,23 @@
@click="changeMethod('PATCH')">PATCH</button>
<button style="padding: 5rpx;margin-right: 10rpx;" type="primary" size="mini"
@click="changeMethod('OPTIONS')">OPTIONS</button>
<button style="padding: 5rpx;" type="primary" size="mini"
@click="changeMethod('HEAD')">HEAD</button>
<button style="padding: 5rpx;" type="primary" size="mini" @click="changeMethod('HEAD')">HEAD</button>
</view>
</view>
<view style="padding: 20rpx;">
<text>请求返回错误码的接口(默认为GET)</text>
<view class="uni-common-pb"></view>
<view style="flex-direction: row;flex-wrap: wrap;">
<button style="padding: 5rpx;" type="primary" size="mini" v-for="(item, index) in errorCodeUrls
"
:key="index"
@click="changeUrl(item)">{{item}}</button>
<button style="padding: 5rpx;" type="primary" size="mini" v-for="(item, index) in errorCodeUrls" :key="index
"
@click="changeUrl(item)">{{item}}</button>
</view>
</view>
<view style="padding: 20rpx;">
<text>请求不同header的接口(默认为GET)</text>
<view class="uni-common-pb"></view>
<view style="flex-direction: row;flex-wrap: wrap;">
<button style="padding: 5rpx;" type="primary" size="mini" v-for="(item, index) in headerUrls
"
:key="index"
@click="changeUrl(item)">{{item}}</button>
<button style="padding: 5rpx;" type="primary" size="mini" v-for="(item, index) in headerUrls" :key="index
"
@click="changeUrl(item)">{{item}}</button>
</view>
</view>
<view style="padding: 20rpx;">
...
...
@@ -62,8 +61,8 @@
<text>POST请求(有body)</text>
<view class="uni-common-pb"></view>
<view style="flex-direction: row;flex-wrap: wrap;">
<button style="padding: 5rpx;" type="primary" size="mini" v-for="(item, index) in postUrls
"
:key="index"
@click="changeUrlFromPost(item)">{{item}}</button>
<button style="padding: 5rpx;" type="primary" size="mini" v-for="(item, index) in postUrls" :key="index
"
@click="changeUrlFromPost(item)">{{item}}</button>
</view>
</view>
</scroll-view>
...
...
@@ -131,6 +130,8 @@
"/api/http/contentType/json",
"/api/http/contentType/xWwwFormUrlencoded",
],
//自动化测试例专用
jest_result: false
}
},
onLoad() {
...
...
@@ -214,6 +215,27 @@
uni.hideLoading()
},
});
},
//自动化测试例专用
jest_request() {
uni.request({
url: this.host + this.url,
// dataType: "json",
// responseType: "json",
method: this.method,
data: this.data,
header: this.header,
timeout: 6000,
sslVerify: false,
withCredentials: false,
firstIpv4: false,
success() {
this.jest_result = true;
},
fail() {
this.jest_result = false;
},
});
}
}
}
...
...
pages/API/upload-file/upload-file.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/upload-file/upload-file
'
describe
(
'
ExtApi-UploadFile
'
,
()
=>
{
let
page
;
let
res
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
await
page
.
callMethod
(
'
jest_uploadFile
'
);
await
page
.
waitFor
(
500
);
res
=
await
page
.
data
(
'
jest_result
'
);
});
it
(
'
Check
'
,
async
()
=>
{
expect
(
res
).
toBe
(
true
);
});
});
pages/API/upload-file/upload-file.uvue
浏览文件 @
b8557693
...
...
@@ -29,7 +29,9 @@ export default {
title: 'uploadFile',
imageSrc: '',
task: null as UploadTask | null,
pageVisible: false
pageVisible: false,
//自动化测试例专用
jest_result:false,
}
},
onLoad() {
...
...
@@ -88,6 +90,24 @@ export default {
console.log('chooseImage fail', err)
}
})
},
//自动化测试例专用
jest_uploadFile(){
const imageSrc = "/static/uni.png";
this.task = uni.uploadFile({
url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,非真实的接口地址
filePath: imageSrc,
name: 'file',
formData: {
'user': 'test'
},
success: () => {
this.jest_result = true;
},
fail: () => {
this.jest_result = false;
},
})
}
}
}
...
...
pages/API/websocket-socketTask/websocket-socketTask.test.js
0 → 100644
浏览文件 @
b8557693
const
PAGE_PATH
=
'
/pages/API/websocket-socketTask/websocket-socketTask
'
describe
(
'
ExtApi-WebSocket
'
,
()
=>
{
let
page
;
let
res
;
beforeAll
(
async
()
=>
{
page
=
await
program
.
reLaunch
(
PAGE_PATH
)
await
page
.
waitFor
(
600
);
await
page
.
callMethod
(
'
jest_connectSocket
'
);
await
page
.
waitFor
(
500
);
res
=
await
page
.
data
(
'
jest_result
'
);
});
it
(
'
Check
'
,
async
()
=>
{
expect
(
res
).
toBe
(
2
);
});
});
pages/API/websocket-socketTask/websocket-socketTask.uvue
浏览文件 @
b8557693
...
...
@@ -36,6 +36,8 @@ export default {
msg: '',
platform: '',
pageVisible: false,
//自动化测试例专用
jest_result: 0,
}
},
computed: {
...
...
@@ -163,6 +165,37 @@ export default {
},
} as CloseSocketOptions)
},
//自动化测试例专用
jest_connectSocket(){
this.socketTask = uni.connectSocket({
url: 'ws://websocket.dcloud.net.cn',
success:(_) => {
this.jest_result++
},
fail:(_) => {
this.jest_result = 0
},
})
this.socketTask?.onOpen((_) => {
const data =
'from ' +
this.platform +
' : ' +
parseInt(Math.random() * 10000 + '').toString()
this.socketTask?.send({
data,
success(_) {
this.jest_result++
},
fail(_) {
this.jest_result = 0
},
} as SendSocketMessageOptions)
})
this.socketTask?.onError((_) => {
this.jest_result = 0;
})
}
},
}
</script>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录