From 6dc287037110017c14eae551dea0295e22d99848 Mon Sep 17 00:00:00 2001 From: PachVerb <1506262681@qq.com> Date: Fri, 5 Jun 2020 05:38:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(smb):=20=E6=96=87=E4=BB=B6=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/library/components/fileList.vue | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/views/main/library/components/fileList.vue b/src/views/main/library/components/fileList.vue index 3f83c909..bbb7fb24 100644 --- a/src/views/main/library/components/fileList.vue +++ b/src/views/main/library/components/fileList.vue @@ -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( // 实列话类 @@ -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':