liuchen864
7 months ago
26 changed files with 167 additions and 83 deletions
@ -1,4 +1,4 @@ |
|||
|
|||
VITE_BASE_URL=http://192.168.0.106:12080/admin-api |
|||
VITE_BASE_URL=http://localhost:12080/admin-api |
|||
#VITE_BASE_URL=http://dev.ccwin-in.com:25203/api/admin-api |
|||
VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api |
|||
VITE_BASE_URL_IMAGE=http://192.168.0.106:12080/admin-api |
@ -1,2 +1,2 @@ |
|||
VITE_BASE_URL=http://10.62.139.32:82/api/admin-api |
|||
VITE_BASE_URL_IMAGE=http://10.62.139.32:82/api/admin-api |
|||
VITE_BASE_URL=http://dev.ccwin-in.com:25210/admin-api |
|||
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25210/admin-api |
|||
|
@ -0,0 +1,8 @@ |
|||
证书名称:pdatest.keystore |
|||
证书别名:pdatestalias |
|||
证书密码:092134 |
|||
SHA1: 53:30:B7:A6:0B:10:FA:0A:5A:3A:2F:4A:E5:21:96:EC:79:5B:41:C1 |
|||
SHA256: C4:85:45:66:D5:FC:6E:FB:C8:45:5D:FA:41:8D:94:6D:E5:C1:41:CE:D0:E3:4D:B3:F9:3B:68:6A:1B:E2:43:86 |
|||
Android 包名:com.eampda.uniapp |
|||
Android 应用签名:aa65e187685c2088b82d1a8c143bbabe//还没弄 |
|||
ios 包名:com.eam.bundleld//还没弄 |
Binary file not shown.
@ -1,60 +1,60 @@ |
|||
import store from '@/store' |
|||
|
|||
|
|||
function authPermission(permission) { |
|||
const all_permission = "*:*:*" |
|||
const permissions = store.getters && store.getters.permissions |
|||
if (permission && permission.length > 0) { |
|||
return permissions.some(v => { |
|||
return all_permission === v || v === permission |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
const all_permission = "*:*:*" |
|||
const permissions =uni.getStorageSync('permissionInfo') |
|||
if (permission && permission.length > 0) { |
|||
return permissions.some(v => { |
|||
return all_permission === v || v === permission |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
} |
|||
|
|||
function authRole(role) { |
|||
const super_admin = "admin" |
|||
const roles = store.getters && store.getters.roles |
|||
if (role && role.length > 0) { |
|||
return roles.some(v => { |
|||
return super_admin === v || v === role |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
const super_admin = "admin" |
|||
const roles = uni.getStorageSync('roles') |
|||
if (role && role.length > 0) { |
|||
return roles.some(v => { |
|||
return super_admin === v || v === role |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
} |
|||
|
|||
export default { |
|||
// 验证用户是否具备某权限
|
|||
hasPermi(permission) { |
|||
return authPermission(permission) |
|||
}, |
|||
// 验证用户是否含有指定权限,只需包含其中一个
|
|||
hasPermiOr(permissions) { |
|||
return permissions.some(item => { |
|||
return authPermission(item) |
|||
}) |
|||
}, |
|||
// 验证用户是否含有指定权限,必须全部拥有
|
|||
hasPermiAnd(permissions) { |
|||
return permissions.every(item => { |
|||
return authPermission(item) |
|||
}) |
|||
}, |
|||
// 验证用户是否具备某角色
|
|||
hasRole(role) { |
|||
return authRole(role) |
|||
}, |
|||
// 验证用户是否含有指定角色,只需包含其中一个
|
|||
hasRoleOr(roles) { |
|||
return roles.some(item => { |
|||
return authRole(item) |
|||
}) |
|||
}, |
|||
// 验证用户是否含有指定角色,必须全部拥有
|
|||
hasRoleAnd(roles) { |
|||
return roles.every(item => { |
|||
return authRole(item) |
|||
}) |
|||
} |
|||
} |
|||
// 验证用户是否具备某权限
|
|||
hasPermi(permission) { |
|||
return authPermission(permission) |
|||
}, |
|||
// 验证用户是否含有指定权限,只需包含其中一个
|
|||
hasPermiOr(permissions) { |
|||
return permissions.some(item => { |
|||
return authPermission(item) |
|||
}) |
|||
}, |
|||
// 验证用户是否含有指定权限,必须全部拥有
|
|||
hasPermiAnd(permissions) { |
|||
return permissions.every(item => { |
|||
return authPermission(item) |
|||
}) |
|||
}, |
|||
// 验证用户是否具备某角色
|
|||
hasRole(role) { |
|||
return authRole(role) |
|||
}, |
|||
// 验证用户是否含有指定角色,只需包含其中一个
|
|||
hasRoleOr(roles) { |
|||
return roles.some(item => { |
|||
return authRole(item) |
|||
}) |
|||
}, |
|||
// 验证用户是否含有指定角色,必须全部拥有
|
|||
hasRoleAnd(roles) { |
|||
return roles.every(item => { |
|||
return authRole(item) |
|||
}) |
|||
} |
|||
} |
Loading…
Reference in new issue