diff --git a/server/core/server.go b/server/core/server.go index d6a3d8ee..573d32f1 100644 --- a/server/core/server.go +++ b/server/core/server.go @@ -29,7 +29,7 @@ func RunWindowsServer() { fmt.Printf(` 欢迎使用 Gin-Vue-Admin - 当前版本:V2.4.0 + 当前版本:V2.4.1 加群方式:微信号:shouzi_1994 QQ群:622360840 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html 默认前端文件运行地址:http://127.0.0.1:8080 diff --git a/server/model/sys_casbin.go b/server/model/sys_casbin.go index 83f55f4d..9bb19886 100644 --- a/server/model/sys_casbin.go +++ b/server/model/sys_casbin.go @@ -1,7 +1,7 @@ package model type CasbinModel struct { - Ptype string `json:"ptype" gorm:"column:p_type"` + Ptype string `json:"ptype" gorm:"column:ptype"` AuthorityId string `json:"rolename" gorm:"column:v0"` Path string `json:"path" gorm:"column:v1"` Method string `json:"method" gorm:"column:v2"` diff --git a/web/src/directive/auth.js b/web/src/directive/auth.js index bf6fc829..821e52d1 100644 --- a/web/src/directive/auth.js +++ b/web/src/directive/auth.js @@ -1,10 +1,10 @@ // 权限按钮展示指令 import { store } from '@/store/index' -const userInfo = store.getters['user/userInfo'] export const auth = (Vue) => { Vue.directive('auth', { // 当被绑定的元素插入到 DOM 中时…… bind: function (el, binding) { + const userInfo = store.getters['user/userInfo'] let type = "" switch (Object.prototype.toString.call(binding.value)) { case "[object Array]": @@ -27,7 +27,6 @@ export const auth = (Vue) => { return } const waitUse = binding.value.toString().split(",") - let flag = waitUse.some(item=>item==userInfo.authorityId) if (binding.modifiers.not) { flag = !flag diff --git a/web/src/main.js b/web/src/main.js index cd7044d6..2884878a 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -52,7 +52,8 @@ import { Steps, Upload, Progress, - MessageBox + MessageBox, + Image } from 'element-ui'; Vue.use(Button); @@ -103,6 +104,7 @@ Vue.use(Upload); Vue.use(Progress); Vue.use(Scrollbar); Vue.use(Loading.directive); +Vue.use(Image) Vue.prototype.$loading = Loading.service; Vue.prototype.$message = Message; @@ -147,7 +149,7 @@ export default new Vue({ console.log(` 欢迎使用 Gin-Vue-Admin - 当前版本:V2.4.0 + 当前版本:V2.4.1 加群方式:微信:shouzi_1994 QQ群:622360840 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html 默认前端文件运行地址:http://127.0.0.1:8080 diff --git a/web/src/utils/request.js b/web/src/utils/request.js index 640985d6..c7a445cf 100644 --- a/web/src/utils/request.js +++ b/web/src/utils/request.js @@ -66,7 +66,7 @@ service.interceptors.response.use( store.commit('user/setToken', response.headers["new-token"]) } if(response.data.code == 0){ - if(response.data.data.needInit){ + if(response.data.data?.needInit){ Message({ type:"info", message:"您是第一次使用,请初始化" diff --git a/web/src/view/superAdmin/api/api.vue b/web/src/view/superAdmin/api/api.vue index e48192c8..1d94642f 100644 --- a/web/src/view/superAdmin/api/api.vue +++ b/web/src/view/superAdmin/api/api.vue @@ -193,7 +193,6 @@ export default { }, async onDelete(){ const ids = this.apis.map(item=>item.ID) - debugger const res = await deleteApisByIds({ids}) if(res.code==0){ this.$message({