diff --git a/src/api/authority.ts b/src/api/authority.ts index 84c0b3d..8afc695 100644 --- a/src/api/authority.ts +++ b/src/api/authority.ts @@ -11,7 +11,7 @@ export interface AuthCreateRecord { // 基础信息 export interface AuthRecord extends AuthCreateRecord { - id: string; + id?: string; } // export interface RoleListRecord extends AuthRecord { @@ -21,7 +21,7 @@ export interface AuthRecord extends AuthCreateRecord { // 查询所有的权限列表 export function queryAuthList(data: any) { return axios({ - url: '/api/rest/auth', // 路径 + url: '/api/rest/authority', // 路径 method: 'get', params: data, // 参数 }) @@ -29,29 +29,26 @@ export function queryAuthList(data: any) { // 切换启用状态 export function enabled(id: string) { - return axios.patch(`/api/rest/auth/toggle/${id}`); + return axios.patch(`/api/rest/authority/toggle/${id}`); } // 删除 export function remove(id: string) { - return axios.delete(`/api/rest/auth/${id}`); + return axios.delete(`/api/rest/authority/${id}`); } // 添加 export function create(data: AuthCreateRecord) { - return axios.post(`/api/rest/auth`, data); + return axios.post(`/api/rest/authority`, data); } // 更新 export function update(data: AuthRecord) { - return axios.patch(`/api/rest/auth/${data.id}`, data); + return axios.patch(`/api/rest/authority/${data.id}`, data); } // 获取详情 export function getDetail(id: string) { - return axios.get(`/api/rest/auth/${id}`); + return axios.get(`/api/rest/authority/${id}`); } -// export function queryRoles(params?: ListParams>) { -// return queryList(`/api/rest/role/query`, params); -// } diff --git a/src/views/system/authority/components/auth-edit.vue b/src/views/system/authority/components/auth-edit.vue index 674dc50..b3a445d 100644 --- a/src/views/system/authority/components/auth-edit.vue +++ b/src/views/system/authority/components/auth-edit.vue @@ -25,7 +25,7 @@ field="name" label="权限名称" :validate-trigger="['change', 'input']" - :rules="[{ required: true, message: t('auth.info.name.required') }]" + :rules="[{ required: true }]" > - - \ No newline at end of file