Browse Source

Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev

main
pixel 4 years ago
parent
commit
e71e3b00a6
  1. 2
      server/core/server.go
  2. 2
      server/model/sys_casbin.go
  3. 3
      web/src/directive/auth.js
  4. 6
      web/src/main.js
  5. 2
      web/src/utils/request.js
  6. 1
      web/src/view/superAdmin/api/api.vue

2
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

2
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"`

3
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

6
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

2
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:"您是第一次使用,请初始化"

1
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({

Loading…
Cancel
Save