| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- import axios from './request'
- // 用户登录接口
- export const userLogin = (data) => {
- return axios({
- method: 'post',
- url: '/admin/login',
- data
- })
- }
- // 获取项目列表
- export const getProjectList = (data) => {
- return axios({
- method: 'post',
- url: '/db/project/list',
- data
- })
- }
- // 新增/编辑项目
- export const addProject = (data) => {
- return axios({
- method: 'post',
- url: '/db/project/save',
- data
- })
- }
- // 删除项目
- export const delProject = (id) => {
- return axios({
- method: 'post',
- url: `/db/project/remove/${id}`
- })
- }
- // 通过id获取项目详情
- export const projectInfoById = (id) => {
- return axios({
- method: 'get',
- url: `/db/project/detail/${id}`
- })
- }
- // -----------------表相关
- // 获取表列表
- export const getTabletList = (data) => {
- return axios({
- method: 'post',
- url: '/db/table/getList',
- data
- })
- }
- // 删除表
- export const delTablet = (data) => {
- return axios({
- method: 'post',
- url: '/db/table/removes',
- data
- })
- }
- // 新增表
- export const addTable = (data) => {
- return axios({
- method: 'post',
- url: '/db/table/createTable',
- data
- })
- }
- // -----------------字段相关
- //获取字段列表
- export const getFieldData = (data) => {
- return axios({
- method: 'post',
- url: "/db/field/getList",
- data
- })
- }
- //添加表字段
- export const addField = (data) => {
- return axios({
- method: 'post',
- url: "/db/field/add",
- data
- })
- }
- //删除字段
- export const delField = (data) => {
- return axios({
- method: 'post',
- url: '/db/field/delField',
- data
- })
- }
- // 通过表id获取详细信息
- export const getInfoById = (tableId,data) => {
- return axios({
- method: 'post',
- url: `/db/record/getFieldData/${tableId}`,
- data
- })
- }
- // 新增数据
- export const recordInsert = (data) => {
- return axios({
- method: 'post',
- url: '/db/record/insert',
- data
- })
- }
- // 编辑数据
- export const recordUpdate = (data) => {
- return axios({
- method: 'post',
- url: '/db/record/update',
- data
- })
- }
- // 根据id获取数据详情
- export const recordDetail = (tableId,id) => {
- return axios({
- method: 'get',
- url: `/db/record/detail/${tableId}/${id}`,
- })
- }
- // 删除数据
- export const recordDel = (tableId,ids) => {
- return axios({
- method: 'get',
- url: `/db/record/del/${tableId}/${ids}`,
- })
- }
- // ---------------白名单相关
- // 列表
- export const ipGetList = (data) => {
- return axios({
- method: 'post',
- url: '/sys/ip/getList',
- data
- })
- }
- // 新增和编辑
- export const ipSave = (data) => {
- return axios({
- method: 'post',
- url: '/sys/ip/save',
- data
- })
- }
- // 删除
- export const ipRemoves = (ids) => {
- return axios({
- method: 'get',
- url: `/sys/ip/removes/${ids}`,
- })
- }
- // ----------------用户相关
- // 列表
- export const userList = (data) => {
- return axios({
- method: 'post',
- url: '/sys/user/list',
- data
- })
- }
- // 新增和编辑用户
- export const userSave = (data) => {
- return axios({
- method: 'post',
- url: '/sys/user/save',
- data
- })
- }
- // 删除用户
- export const userRemoves = (ids) => {
- return axios({
- method: 'get',
- url: `/sys/user/removes/${ids}`,
- })
- }
- // 重置密码
- export const userResetPass = (id) => {
- return axios({
- method: 'get',
- url: `/sys/user/resetPass/${id}`,
- })
- }
- // 修改密码
- export const userUpdatePwd = (data) => {
- return axios({
- method: 'post',
- url: '/sys/user/updatePwd',
- data
- })
- }
- // 获取用户详情
- export const userDetail = (id) => {
- return axios({
- method: 'get',
- url: `/sys/user/detail/${id}`,
- })
- }
- // 授权项目
- export const userAuth = (projectIds,userId) => {
- return axios({
- method: 'get',
- url: `/sys/user/auth/${projectIds}/${userId}`,
- })
- }
|