提交 d399c588 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

修复了api设置时候可以重复path的bug

上级 f962b51f
......@@ -31,7 +31,7 @@ func CasbinPUpdata(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateAuthorityParams true "获取权限列表"
// @Param data body sysModel.CasbinInReceive true "获取权限列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/getPolicyPathByAuthorityId [post]
func GetPolicyPathByAuthorityId(c *gin.Context) {
......@@ -46,7 +46,7 @@ func GetPolicyPathByAuthorityId(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateAuthorityParams true "获取权限列表"
// @Param data body sysModel.CasbinInReceive true "获取权限列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/CasbinTest [get]
func CasbinTest(c *gin.Context) {
......
......@@ -37,6 +37,10 @@ func (a *SysApi) DeleteApi() (err error) {
//更新api
func (a *SysApi) UpdataApi() (err error) {
var oldA SysApi
flag := qmsql.DEFAULTDB.Where("path = ?", a.Path).RecordNotFound()
if !flag {
return errors.New("存在相同api路径")
}
err = qmsql.DEFAULTDB.Where("id = ?", a.ID).First(&oldA).Error
if err != nil {
return err
......
......@@ -55,7 +55,7 @@ service.interceptors.request.use(
service.interceptors.response.use(
response => {
closeLoading()
if (response.data.success || response.headers.success==="true") {
if (response.data.success || response.headers.success === "true") {
return response.data
} else {
Message({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册