mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-02-02 21:27:15 +08:00
user can specify share password for private share
This commit is contained in:
parent
4cf51f24fe
commit
4c89bbc652
@ -50,6 +50,9 @@ func CmdShare() cli.Command {
|
||||
创建文件 1.mp4 的分享链接
|
||||
aliyunpan share set 1.mp4
|
||||
|
||||
创建文件 1.mp4 的分享链接,并指定分享密码为2333
|
||||
aliyunpan share set -sharePwd 2333 1.mp4
|
||||
|
||||
创建文件 1.mp4 的分享链接,并指定有效期为1天
|
||||
aliyunpan share set -time 1 1.mp4
|
||||
`,
|
||||
@ -77,12 +80,18 @@ func CmdShare() cli.Command {
|
||||
}
|
||||
|
||||
sharePwd := ""
|
||||
if c.IsSet("sharePwd") {
|
||||
sharePwd = c.String("sharePwd")
|
||||
}
|
||||
|
||||
modeFlag := "1"
|
||||
if c.IsSet("mode") {
|
||||
modeFlag = c.String("mode")
|
||||
}
|
||||
if modeFlag == "1" {
|
||||
sharePwd = RandomStr(4)
|
||||
if sharePwd == "" {
|
||||
sharePwd = RandomStr(4)
|
||||
}
|
||||
} else {
|
||||
sharePwd = ""
|
||||
}
|
||||
@ -105,6 +114,11 @@ func CmdShare() cli.Command {
|
||||
Usage: "有效期,1-私密分享,2-公开分享",
|
||||
Value: "1",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "sharePwd",
|
||||
Usage: "自定义私密分享密码,4个字符,没有指定则随机生成",
|
||||
Value: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user