Skip to content

命令添加用户 #4932

Answered by xhofe
lovezongzi asked this question in Q&A
Aug 5, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

你可以调用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可以通过管理员-管理-设置-其他-令牌获取。

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@lovezongzi
Comment options

@xinglufan
Comment options

Answer selected by xhofe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants