SPA項目CRUD接口文檔

後臺接口API文檔

用戶登錄

接口調用請求說明
http請求方式: post
http://localhost:8080/tang_ssh/vue/userAction_login.action

請求參數

參數 說明
uname 登錄的用戶名;必填
pwd 登錄的密碼(必填)
code 狀態 (登錄成功返回 1)(登錄失敗返回 0)
result 返回參數

返回說明
登錄成功返回JSON數據包:

{
	"code": 1,
	"msg": "登錄成功",
	"result":{
		"uname":"zs",
		"pwd":"123"
	}
}

登錄失敗返回JSON數據包:

用戶名或密碼爲空
{
	"code": 0,
	"msg": "用戶名或密碼爲空",
	"result":{
		"uname":"",
		"pwd":""
	}
}

用戶名或密碼不正確
{
	"code": 0,
	"msg": "用戶名或密碼不正確",
	"result":{
		"uname":"aa",
		"pwd":"aa"
	}
}

樹形菜單

接口調用請求說明
http請求方式: post
http://localhost:8080/tang_ssh/vue/treeNodeAction.action

請求參數

參數 說明
result 返回樹形菜單的結果集
code 狀態 (操作成功返回 1)(操作失敗返回 0)
treeNodeId 菜單編號
treeNodeName 菜單名稱
treeNodeType 菜單類型 (1 :父菜單、2:跳轉菜單)
url 跳轉的路徑
children 子菜單

返回說明

{
	"msg": "操作成功",
	"code": 1,
	"result": [
		{
			"treeNodeId": 1,
			"treeNodeName": "系統管理",
			"treeNodeType": 1,
			"url": null,
			"position": 1,
			"icon": "el-icon-setting",
			"children": [
				{
					"treeNodeId": 2,
					"treeNodeName": "用戶管理",
					"treeNodeType": 2,
					"url": "/sys/VuexPage1",
					"position": 2,
					"icon": "el-icon-user",
					"children": []
				},
				{
					"treeNodeId": 3,
					"treeNodeName": "角色管理",
					"treeNodeType": 2,
					"url": "/sys/VuexPage2",
					"position": 3,
					"icon": "",
					"children": []
				},
				{
					"treeNodeId": 4,
					"treeNodeName": "密碼修改",
					"treeNodeType": 2,
					"url": null,
					"position": 4,
					"icon": null,
					"children": []
				}
			]
		},
		{
			"treeNodeId": 5,
			"treeNodeName": "論壇管理",
			"treeNodeType": 1,
			"url": null,
			"position": 5,
			"icon": "el-icon-reading",
			"children": [
				{
					"treeNodeId": 6,
					"treeNodeName": "文章管理",
					"treeNodeType": 2,
					"url": "/sys/Articles",
					"position": 6,
					"icon": null,
					"children": []
				}
			]
		}
	]
}

文章查詢

接口調用請求說明
http請求方式: post
http://localhost:8080/tang_ssh/vue/articleAction_list.action

請求參數

參數 說明
id 文章編號
title 文章標題
body 文章內容
page 當前頁碼
rows 每頁顯示的數據量
maxPage 最大頁碼
pagination 是否分頁

返回說明

{
	"result":{
		"id":12,
		"title":"mysql",
		"body":"得得得得得得得得得"
	},
	"pageBean":{
		"page":1,
		"rows":10,
		"total":156,
		"maxPage": 16,
		"pagination": true,
	}
}

文章增加

接口調用請求說明
http請求方式: post
http://localhost:8080/tang_ssh/vue/articleAction_add.action

請求參數

參數 說明
title 文章標題
body 文章內容
code 狀態:(增加失敗返回 0) (增加成功返回 1)
result 返回增加的參數

返回說明

增加成功返回JSON數據包:

{
	"msg":"增加成功",
	"result":[],
	"code":1
}

增加失敗返回JSON數據包:

{
	"msg":"增加失敗",
	"result":[],
	"code":0
}

文章修改

接口調用請求說明
http請求方式: post
http://localhost:8080/tang_ssh/vue/articleAction_edit.action

請求參數

參數 說明
id 文章編號
title 文章內容
body 文章內容
code 狀態:(修改失敗返回 0) (修改成功返回 1)

返回說明

修改成功返回JSON數據包:

{
	"msg":"修改成功",
	"code":1
}

修改失敗返回JSON數據包:

{
	"msg":"修改失敗",
	"code":0
}

文章刪除

接口調用請求說明
http請求方式: post
http://localhost:8080/tang_ssh/vue/articleAction_del.action

請求參數

參數 說明
id 文章編號
code 狀態:(刪除失敗返回 0) (刪除成功返回 1)

返回說明

刪除成功返回JSON數據包:

{
	"msg":"刪除成功",
	"code":1
}

刪除失敗返回JSON數據包:

{
	"msg":"刪除失敗",
	"code":0
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章