命令添加用户 #4932
Answered
by
xhofe
lovezongzi
asked this question in
Q&A
命令添加用户
#4932
-
现在的alist据我浅略了解,只能通过web端的后台进行添加用户,是否可以在配置文件或者其他方法进行添加用户呢,我自己做了个登陆页面,和注册页面,想用户注册完之后将数据发送到alist的文件中进行添加用户 |
Beta Was this translation helpful? Give feedback.
Answered by
xhofe
Aug 5, 2023
Replies: 1 comment 2 replies
-
你可以调用alist的接口: fetch("https://$DOMAIN/api/admin/user/create", {
"headers": {
"authorization": "$TOKEN",
"content-type": "application/json;charset=UTF-8",
},
"body": JSON.stringify({
"id": 0,
"username": "test",
"password": "test",
"base_path": "/",
"role": 0,
"permission": 0,
"disabled": false,
"sso_id": ""
}),
"method": "POST"
}); 其中Token可以通过 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
xhofe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你可以调用alist的接口:
其中Token可以通过
管理员-管理-设置-其他-令牌
获取。