提交 0d582f40 编写于 作者: 杜庆泉's avatar 杜庆泉

get-file-system-manager 示例修改any为明确的类型

上级 ee7e62aa
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
this.statsRet = res.stats this.statsRet = res.stats
console.log('this.statsRet', this.statsRet) console.log('this.statsRet', this.statsRet)
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'statFileInfoTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'statFileInfoTest fail:' + JSON.stringify(res) + '\n\n'
console.log('statFileInfoTest fail', res) console.log('statFileInfoTest fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
this.getFileInfoSize = res.size this.getFileInfoSize = res.size
this.getFileInfoDigest = res.digest this.getFileInfoDigest = res.digest
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'getFileInfoTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'getFileInfoTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
this.log += 'copyFileTest success:' + JSON.stringify(res) + '\n\n' this.log += 'copyFileTest success:' + JSON.stringify(res) + '\n\n'
console.log('success', res) console.log('success', res)
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
this.log += 'renameFileTest success:' + JSON.stringify(res) + '\n\n' this.log += 'renameFileTest success:' + JSON.stringify(res) + '\n\n'
console.log('success', res) console.log('success', res)
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'renameFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'renameFileTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
console.log("success", res) console.log("success", res)
this.fileListSuccess = res.files this.fileListSuccess = res.files
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'readDirTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'readDirTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -216,16 +216,16 @@ ...@@ -216,16 +216,16 @@
filePath: `${this.basePath}${this.writeFile}`, filePath: `${this.basePath}${this.writeFile}`,
data: this.writeFileContent, data: this.writeFileContent,
encoding: this.writeFileEncoding, encoding: this.writeFileEncoding,
success: function (res) { success: function (res : FileManagerSuccessResult) {
this.log += 'writeFileTest success:' + JSON.stringify(res) + '\n\n' this.log += 'writeFileTest success:' + JSON.stringify(res) + '\n\n'
console.log('success', res) console.log('success', res)
}, },
fail: function (res) { fail: function (res : UniError) {
this.log += 'writeFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'writeFileTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail') console.log('fail')
this.lastFailError = res this.lastFailError = res
}, },
complete: function (res) { complete: function (res : any) {
this.done = true this.done = true
console.log("complete") console.log("complete")
if (res instanceof UniError) { if (res instanceof UniError) {
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
console.log('success', res) console.log('success', res)
this.readFileRet = res.data this.readFileRet = res.data
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'readFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'readFileTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
this.log += 'rmdirTest success:' + JSON.stringify(res) + '\n\n' this.log += 'rmdirTest success:' + JSON.stringify(res) + '\n\n'
console.log('success', res) console.log('success', res)
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'rmdirTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'rmdirTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
this.log += 'mkdirTest success:' + JSON.stringify(res) + '\n\n' this.log += 'mkdirTest success:' + JSON.stringify(res) + '\n\n'
console.log('success', res) console.log('success', res)
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'mkdirTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'mkdirTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
...@@ -394,7 +394,7 @@ ...@@ -394,7 +394,7 @@
} as UnLinkOptions) } as UnLinkOptions)
}); });
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail to readdir', res) console.log('fail to readdir', res)
this.lastFailError = res this.lastFailError = res
...@@ -422,7 +422,7 @@ ...@@ -422,7 +422,7 @@
this.log += 'copyFileTest success:' + JSON.stringify(res) + '\n\n' this.log += 'copyFileTest success:' + JSON.stringify(res) + '\n\n'
console.log('success', res) console.log('success', res)
}, },
fail: function (res : any) { fail: function (res : UniError) {
this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n'
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError = res
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册