Commit ef64f164 authored by zhangke's avatar zhangke

auth

parent 3fb962b0
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthConsoleGetReq extends Model<AuthConsoleGetReq> {
@JsonProperty() userId: string
constructor(payload: Partial<AuthConsoleGetReq>) {
super(payload)
}
}
@Serializable()
export class AuthConsole extends Model<AuthConsole> {
constructor(payload: Partial<AuthConsole>) {
super(payload)
}
/**
* 获取控制台列表
* @param payload
*/
static async get(payload: AuthConsoleGetReq) {
return await api.get<HttpResponse>('/services/auth-service/console', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthMenuInfoGetReq extends Model<AuthMenuInfoGetReq> {
@JsonProperty() objectId: string
@JsonProperty() userId: string
constructor(payload: Partial<AuthMenuInfoGetReq>) {
super(payload)
}
}
@Serializable()
export class AuthOperationRoleTree extends Model<AuthOperationRoleTree> {
constructor(payload: Partial<AuthOperationRoleTree>) {
super(payload)
}
/**
* 获取菜单信息
* @param payload
*/
static async get(payload: AuthMenuInfoGetReq) {
return await api.get<HttpResponse>('/services/auth-service/menu/info', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthOperationGetReq extends Model<AuthOperationGetReq> {
@JsonProperty() userId: string
@JsonProperty() objectId: string
constructor(payload: Partial<AuthOperationGetReq>) {
super(payload)
}
}
@Serializable()
export class AuthOperation extends Model<AuthOperation> {
constructor(payload: Partial<AuthOperation>) {
super(payload)
}
/**
* 根据类型id获取对象列表
* @param payload
*/
static async get(payload: AuthOperationGetReq) {
return await api.get<HttpResponse>('/services/auth-service/operation', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthOperationRoleGetReq extends Model<AuthOperationRoleGetReq> {
@JsonProperty() roleId: string
constructor(payload: Partial<AuthOperationRoleGetReq>) {
super(payload)
}
}
@Serializable()
export class AuthOperationRole extends Model<AuthOperationRole> {
constructor(payload: Partial<AuthOperationRole>) {
super(payload)
}
/**
* 查询角色在对象上的权限信息(设置)
* @param payload
*/
static async get(payload: AuthOperationRoleGetReq) {
return await api.get<HttpResponse>('/services/auth-service/operation/role', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthOperationRoleTreeGetReq extends Model<AuthOperationRoleTreeGetReq> {
@JsonProperty() roleId: string
constructor(payload: Partial<AuthOperationRoleTreeGetReq>) {
super(payload)
}
}
@Serializable()
export class AuthOperationRoleTree extends Model<AuthOperationRoleTree> {
constructor(payload: Partial<AuthOperationRoleTree>) {
super(payload)
}
/**
* 查询角色在对象上的权限信息(查看)
* @param payload
*/
static async get(payload: AuthOperationRoleTreeGetReq) {
return await api.get<HttpResponse>('/services/auth-service/operation/role/tree', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthOperationUserGetReq extends Model<AuthOperationUserGetReq> {
@JsonProperty() userId: string
@JsonProperty() objectId: string
constructor(payload: Partial<AuthOperationUserGetReq>) {
super(payload)
}
}
@Serializable()
export class AuthOperationUser extends Model<AuthOperationUser> {
constructor(payload: Partial<AuthOperationUser>) {
super(payload)
}
/**
* 获取按钮权限信息
* @param payload
*/
static async get(payload: AuthOperationUserGetReq) {
return await api.get<HttpResponse>('/services/auth-service/operation/user', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthOperationUserRole extends Model<AuthOperationUserRole> {
constructor(payload: Partial<AuthOperationUserRole>) {
super(payload)
}
/**
* 模糊搜索当前控制台的角色
*/
static async get() {
return await api.get<HttpResponse>('/services/auth-service/operation/user/role')
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthRolePostReq extends Model<AuthRolePostReq> {
@JsonProperty() name: string
@JsonProperty() description: string
@JsonProperty() type: number
@JsonProperty() objectId: string
constructor(payload: Partial<AuthRolePostReq>) {
super(payload)
}
}
@Serializable()
export class AuthRolePutReq extends Model<AuthRolePutReq> {
@JsonProperty() id: string
@JsonProperty() name: string
@JsonProperty() description: string
constructor(payload: Partial<AuthRolePutReq>) {
super(payload)
}
}
@Serializable()
export class AuthRole extends Model<AuthRole> {
constructor(payload: Partial<AuthRole>) {
super(payload)
}
/**
* 新增角色
* @param payload
*/
static async post(payload: AuthRolePostReq) {
return await api.post<HttpResponse>('/services/auth-service/role', {
data: payload,
})
}
/**
* 修改角色
* @param payload
*/
static async put(payload: AuthRolePutReq) {
return await api.put<HttpResponse>('/services/auth-service/role', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthRoleAuthPutReq extends Model<AuthRoleAuthPutReq> {
@JsonProperty() objId: string
@JsonProperty() opIds: []
@JsonProperty() roleId: string
constructor(payload: Partial<AuthRoleAuthPutReq>) {
super(payload)
}
}
@Serializable()
export class AuthRoleAuth extends Model<AuthRoleAuth> {
constructor(payload: Partial<AuthRoleAuth>) {
super(payload)
}
/**
* 修改角色权限
* @param payload
*/
static async put(payload: AuthRoleAuthPutReq) {
return await api.put<HttpResponse>('/services/auth-service/role/auth', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
import { AuthRoleAuthPutReq } from '@shared/models/auth-service/AuthRoleAuth'
@Serializable()
export class AuthRoleAuthSuperGetReq extends Model<AuthRoleAuthSuperGetReq> {
@JsonProperty() roleId: string
constructor(payload: Partial<AuthRoleAuthSuperGetReq>) {
super(payload)
}
}
@Serializable()
export class AuthRoleAuthSuperPutReq extends Model<AuthRoleAuthSuperPutReq> {
@JsonProperty() payload: []
constructor(payload: Partial<AuthRoleAuthSuperPutReq>) {
super(payload)
}
}
@Serializable()
export class AuthRoleAuthSuper extends Model<AuthRoleAuthSuper> {
constructor(payload: Partial<AuthRoleAuthSuper>) {
super(payload)
}
/**
* 查询角色在各个对象上的权限信息(超管设置权限)
*/
static async get(payload: AuthRoleAuthSuperGetReq) {
return await api.get<HttpResponse>('/services/auth-service/role/auth/super', {
params: payload,
})
}
/**
* 设置权限(超管)
* @param payload
*/
static async put(payload: AuthRoleAuthSuperPutReq) {
return await api.put<HttpResponse>('/services/auth-service/role/auth/super', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthRolePermissionPagePostReq extends Model<AuthRolePermissionPagePostReq> {
@JsonProperty() objectId: string
@JsonProperty() userId: string
@JsonProperty() pageIndex?: string
@JsonProperty() pageSize: string
@JsonProperty() param: string
constructor(payload: Partial<AuthRolePermissionPagePostReq>) {
super(payload)
}
}
@Serializable()
export class AuthRolePermissionPage extends Model<AuthRolePermissionPage> {
@JsonProperty() list: []
@JsonProperty() totalCount: number
constructor(payload: Partial<AuthRolePermissionPage>) {
super(payload)
}
/**
* 分页查询角色权限列表
* @param payload
*/
static async post(payload: AuthRolePermissionPagePostReq) {
return await api.post<HttpResponse>('/services/auth-service/role/permission/page', {
data: payload,
})
}
}
import { JsonProperty, Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthRoleRoleIdDeleteReq extends Model<AuthRoleRoleIdDeleteReq> {
@JsonProperty() roleId: string
constructor(payload: Partial<AuthRoleRoleIdDeleteReq>) {
super(payload)
}
}
@Serializable()
export class AuthRoleRoleId extends Model<AuthRoleRoleId> {
constructor(payload: Partial<AuthRoleRoleId>) {
super(payload)
}
/**
* 删除当前控制台的角色
* @param payload
*/
static async delete(payload: AuthRoleRoleIdDeleteReq) {
return await api.delete<HttpResponse>('/services/auth-service/role/{roleId}', {
data: payload,
})
}
}
import { Serializable } from 'typescript-json-serializer'
import { api } from '@shared/http/axios'
import { HttpResponse } from '@shared/http/HttpResponse'
import { Model } from '@shared/models/Model'
@Serializable()
export class AuthRolesConsole extends Model<AuthRolesConsole> {
/**
* 根据对象id获取所有角色信息
*/
static async get() {
return await api.get<HttpResponse>('/services/auth-service/role/console')
}
constructor(payload: Partial<AuthRolesConsole>) {
super(payload)
}
}
......@@ -95,11 +95,7 @@ module.exports = defineConfig({
proxy: {
// 开发环境代理配置
'/root': {
// target: 'http://172.22.16.200:8088',
// target: 'http://172.22.16.200:8088',
// target: 'http://172.22.18.151:8088',
target: 'http://172.22.18.152:8088',
// target: 'http://172.22.16.195:8088',
changeOrigin: true,
pathRewrite: {
'^/root': '',
......@@ -113,14 +109,6 @@ module.exports = defineConfig({
changeOrigin: true,
target: 'http://172.22.17.108:8088',
},
'/storage': {
pathRewrite: {
'^/storage': '',
},
ws: true,
changeOrigin: true,
target: 'http://172.22.18.151:1180',
},
},
},
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment