Skip to content

Commit

Permalink
feat(smb): 文件创建
Browse files Browse the repository at this point in the history
  • Loading branch information
PachVerb committed Jun 4, 2020
1 parent 35e25f1 commit 6dc2870
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions src/views/main/library/components/fileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@ export default {
},
// 创建目录
async submitForm() {
var config = JSON.parse(localStorage.getItem('config'))[
Number(this.servertypeIndex)
]
const { host, user, pwd } = config
switch (this.parents[0]) {
case 'ftp':
var createD = new Server( // 实列话类
Expand All @@ -395,15 +399,20 @@ export default {
)
break
case 'smb':
// var smbclient = new SMB({
// share: '\\\\172.17.6.8\\share',
// domain: 'WORKGROUP',
// username: 'smb',
// password: '175623',
// })
// smbclient.mkdir('newFle', (res) => {
// console.log(res)
// })
var smbclient = new SMB({
share: `\\\\${host}\\share`,
domain: 'WORKGROUP',
username: user,
password: pwd,
})
smbclient.mkdir(this.ruleForm.name, (error, res) => {
if (error) {
this.centerDialogVisible = false
throw error
}
console.log(res)
this.centerDialogVisible = false
})
this.smbClient()
break
case 'baid':
Expand Down

0 comments on commit 6dc2870

Please sign in to comment.