Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
center-zws
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
center-zws
Commits
acb544f3
提交
acb544f3
authored
12月 20, 2022
作者:
王鹏飞
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: update
上级
6a4cd50b
隐藏空白字符变更
内嵌
并排
正在显示
21 个修改的文件
包含
63 行增加
和
23 行删除
+63
-23
.env
.env
+3
-0
.env.dev
.env.dev
+3
-0
.env.test
.env.test
+3
-0
base.ts
src/api/base.ts
+8
-1
menus.ts
src/assets/menus.ts
+16
-9
index.ts
src/modules/base/channel/index.ts
+4
-0
api.ts
src/modules/system/roles/api.ts
+0
-0
UserInfo.vue
src/modules/system/roles/components/UserInfo.vue
+0
-0
index.ts
src/modules/system/roles/index.ts
+1
-1
types.ts
src/modules/system/roles/types.ts
+0
-0
Details.vue
src/modules/system/roles/views/Details.vue
+0
-0
Index.vue
src/modules/system/roles/views/Index.vue
+1
-1
api.ts
src/modules/system/users/api.ts
+0
-0
UserInfo.vue
src/modules/system/users/components/UserInfo.vue
+0
-0
index.ts
src/modules/system/users/index.ts
+5
-1
types.ts
src/modules/system/users/types.ts
+0
-0
Index.vue
src/modules/system/users/views/Index.vue
+0
-0
index.ts
src/router/index.ts
+1
-1
user.ts
src/stores/user.ts
+4
-8
axios.ts
src/utils/axios.ts
+13
-0
vite.config.ts
vite.config.ts
+1
-1
没有找到文件。
.env
浏览文件 @
acb544f3
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_SECRET_ID=ezijing_964c8383203c73b1a15b9f78d029be47
VITE_SECRET_KEY=9ca37c562fa85402a201a54ee105a59c
\ No newline at end of file
.env.dev
浏览文件 @
acb544f3
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_LOGIN_URL=https://login.ezijing.com/auth/login/index
VITE_SECRET_ID=ezijing_964c8383203c73b1a15b9f78d029be47
VITE_SECRET_KEY=9ca37c562fa85402a201a54ee105a59c
\ No newline at end of file
.env.test
浏览文件 @
acb544f3
VITE_LOGIN_URL
=
https
://
login2
.
ezijing
.
com
/
auth
/
login
/
index
VITE_LOGIN_URL
=
https
://
login2
.
ezijing
.
com
/
auth
/
login
/
index
VITE_SECRET_ID
=
ezijing_964c8383203c73b1a15b9f78d029be47
VITE_SECRET_KEY
=
9
ca37c562fa85402a201a54ee105a59c
\ No newline at end of file
src/api/base.ts
浏览文件 @
acb544f3
...
@@ -2,7 +2,7 @@ import httpRequest from '@/utils/axios'
...
@@ -2,7 +2,7 @@ import httpRequest from '@/utils/axios'
// 获取用户信息
// 获取用户信息
export
function
getUser
()
{
export
function
getUser
()
{
return
httpRequest
.
get
(
'/api/
resource/v1/util/
info'
)
return
httpRequest
.
get
(
'/api/
passport/account/get-user-
info'
)
}
}
// 退出登录
// 退出登录
...
@@ -33,3 +33,10 @@ export async function uploadFile(data: Record<string, any>) {
...
@@ -33,3 +33,10 @@ export async function uploadFile(data: Record<string, any>) {
export
function
searchUser
(
params
:
{
q
:
string
})
{
export
function
searchUser
(
params
:
{
q
:
string
})
{
return
httpRequest
.
get
(
'/api/zws/v1/backend/common/search-user'
,
{
params
})
return
httpRequest
.
get
(
'/api/zws/v1/backend/common/search-user'
,
{
params
})
}
}
/**
* 获取权限列表
*/
export
function
getPermissions
(
params
?:
{
type
:
number
})
{
return
httpRequest
.
get
(
'/api/permissions/api/v1/user/permissions'
,
{
params
})
}
src/assets/menus.ts
浏览文件 @
acb544f3
...
@@ -8,27 +8,34 @@ export const menus: IMenuItem[] = [
...
@@ -8,27 +8,34 @@ export const menus: IMenuItem[] = [
{
{
icon
:
Box
,
icon
:
Box
,
name
:
'渠道管理'
,
name
:
'渠道管理'
,
path
:
'/base/channel'
path
:
'/base/channel'
,
tag
:
'channel'
},
},
{
{
icon
:
Files
,
icon
:
Files
,
name
:
'项目管理'
,
name
:
'项目管理'
,
path
:
'/base/project'
path
:
'/base/project'
,
},
tag
:
'project'
}
]
},
{
name
:
'权限管理'
,
path
:
'/system'
,
tag
:
'management'
,
children
:
[
{
{
icon
:
User
,
icon
:
User
,
name
:
'用户管理'
,
name
:
'用户管理'
,
path
:
'/base/users'
path
:
'/system/users'
,
tag
:
'management-member'
},
},
{
{
icon
:
Star
,
icon
:
Star
,
name
:
'角色管理'
,
name
:
'角色管理'
,
path
:
'/base/roles'
path
:
'/system/roles'
,
tag
:
'management-role'
}
}
]
]
},
{
name
:
'权限管理'
,
path
:
'https://app.ezijing.com/settings/users?appid=131614279236792320'
}
}
]
]
src/modules/base/channel/index.ts
浏览文件 @
acb544f3
...
@@ -2,6 +2,10 @@ import type { RouteRecordRaw } from 'vue-router'
...
@@ -2,6 +2,10 @@ import type { RouteRecordRaw } from 'vue-router'
import
AppLayout
from
'@/components/layout/Index.vue'
import
AppLayout
from
'@/components/layout/Index.vue'
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
{
path
:
'/base'
,
redirect
:
'/base/channel'
},
{
{
path
:
'/base/channel'
,
path
:
'/base/channel'
,
component
:
AppLayout
,
component
:
AppLayout
,
...
...
src/modules/
base
/roles/api.ts
→
src/modules/
system
/roles/api.ts
浏览文件 @
acb544f3
File moved
src/modules/
base
/roles/components/UserInfo.vue
→
src/modules/
system
/roles/components/UserInfo.vue
浏览文件 @
acb544f3
File moved
src/modules/
base
/roles/index.ts
→
src/modules/
system
/roles/index.ts
浏览文件 @
acb544f3
...
@@ -3,7 +3,7 @@ import AppLayout from '@/components/layout/Index.vue'
...
@@ -3,7 +3,7 @@ import AppLayout from '@/components/layout/Index.vue'
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
{
{
path
:
'/
base
/roles'
,
path
:
'/
system
/roles'
,
component
:
AppLayout
,
component
:
AppLayout
,
children
:
[
children
:
[
{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
},
{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
},
...
...
src/modules/
base
/roles/types.ts
→
src/modules/
system
/roles/types.ts
浏览文件 @
acb544f3
File moved
src/modules/
base
/roles/views/Details.vue
→
src/modules/
system
/roles/views/Details.vue
浏览文件 @
acb544f3
File moved
src/modules/
base
/roles/views/Index.vue
→
src/modules/
system
/roles/views/Index.vue
浏览文件 @
acb544f3
...
@@ -31,7 +31,7 @@ const listOptions = $computed(() => {
...
@@ -31,7 +31,7 @@ const listOptions = $computed(() => {
// 查看
// 查看
function
handleView
(
row
:
any
)
{
function
handleView
(
row
:
any
)
{
router
.
push
({
path
:
`/
base
/roles/detail/
${
row
.
id
}
`
})
router
.
push
({
path
:
`/
system
/roles/detail/
${
row
.
id
}
`
})
}
}
</
script
>
</
script
>
...
...
src/modules/
base
/users/api.ts
→
src/modules/
system
/users/api.ts
浏览文件 @
acb544f3
File moved
src/modules/
base
/users/components/UserInfo.vue
→
src/modules/
system
/users/components/UserInfo.vue
浏览文件 @
acb544f3
File moved
src/modules/
base
/users/index.ts
→
src/modules/
system
/users/index.ts
浏览文件 @
acb544f3
...
@@ -3,7 +3,11 @@ import AppLayout from '@/components/layout/Index.vue'
...
@@ -3,7 +3,11 @@ import AppLayout from '@/components/layout/Index.vue'
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
export
const
routes
:
Array
<
RouteRecordRaw
>
=
[
{
{
path
:
'/base/users'
,
path
:
'/system'
,
redirect
:
'/system/users'
},
{
path
:
'/system/users'
,
component
:
AppLayout
,
component
:
AppLayout
,
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
children
:
[{
path
:
''
,
component
:
()
=>
import
(
'./views/Index.vue'
)
}]
}
}
...
...
src/modules/
base
/users/types.ts
→
src/modules/
system
/users/types.ts
浏览文件 @
acb544f3
File moved
src/modules/
base
/users/views/Index.vue
→
src/modules/
system
/users/views/Index.vue
浏览文件 @
acb544f3
File moved
src/router/index.ts
浏览文件 @
acb544f3
...
@@ -3,7 +3,7 @@ import { useUserStore } from '@/stores/user'
...
@@ -3,7 +3,7 @@ import { useUserStore } from '@/stores/user'
const
router
=
createRouter
({
const
router
=
createRouter
({
history
:
createWebHistory
(),
history
:
createWebHistory
(),
routes
:
[{
path
:
'/:pathMatch(.*)*'
,
redirect
:
'/base
/channel
'
}]
routes
:
[{
path
:
'/:pathMatch(.*)*'
,
redirect
:
'/base'
}]
})
})
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
...
...
src/stores/user.ts
浏览文件 @
acb544f3
import
{
defineStore
}
from
'pinia'
import
{
defineStore
}
from
'pinia'
import
{
getUser
,
logout
}
from
'@/api/base'
import
{
getUser
,
logout
,
getPermissions
}
from
'@/api/base'
import
type
{
UserType
,
ProjectType
,
OrganizationType
,
RoleType
,
PermissionType
}
from
'@/types'
import
type
{
UserType
,
ProjectType
,
OrganizationType
,
RoleType
,
PermissionType
}
from
'@/types'
interface
State
{
interface
State
{
...
@@ -25,13 +25,9 @@ export const useUserStore = defineStore({
...
@@ -25,13 +25,9 @@ export const useUserStore = defineStore({
actions
:
{
actions
:
{
async
getUser
()
{
async
getUser
()
{
const
res
=
await
getUser
()
const
res
=
await
getUser
()
const
{
info
}
=
res
.
data
const
resp
=
await
getPermissions
()
const
{
organization
,
project
,
roles
,
permissions
}
=
res
.
data
.
permissions
this
.
user
=
res
.
data
this
.
user
=
info
this
.
permissions
=
resp
.
data
.
items
this
.
organization
=
organization
this
.
project
=
project
this
.
roles
=
roles
this
.
permissions
=
permissions
},
},
async
logout
()
{
async
logout
()
{
await
logout
()
await
logout
()
...
...
src/utils/axios.ts
浏览文件 @
acb544f3
...
@@ -13,6 +13,19 @@ const httpRequest = axios.create({
...
@@ -13,6 +13,19 @@ const httpRequest = axios.create({
// 请求拦截
// 请求拦截
httpRequest
.
interceptors
.
request
.
use
(
httpRequest
.
interceptors
.
request
.
use
(
function
(
config
)
{
function
(
config
)
{
// 权限接口单独签名
// https://gitlab.ezijing.com/root/api-documents/-/blob/master/ezijing_permissions/%E7%AD%BE%E5%90%8D%E9%AA%8C%E8%AF%81.md
if
(
/^
\/
api
\/
permissions/
.
test
(
config
.
url
))
{
// 默认参数
const
defaultHeaders
=
{
timestamp
:
Date
.
now
(),
nonce
:
Math
.
random
().
toString
(
36
).
slice
(
-
8
),
'secret-id'
:
import
.
meta
.
env
.
VITE_SECRET_ID
,
'secret-key'
:
import
.
meta
.
env
.
VITE_SECRET_KEY
,
signature
:
'UG7wBenexQhiuD2wpCwuxkU0jqcj006d'
}
config
.
headers
=
Object
.
assign
(
config
.
headers
,
defaultHeaders
)
}
if
(
config
.
headers
?.[
'Content-Type'
]
===
'application/x-www-form-urlencoded'
)
{
if
(
config
.
headers
?.[
'Content-Type'
]
===
'application/x-www-form-urlencoded'
)
{
config
.
data
=
qs
.
stringify
(
config
.
data
,
{
skipNulls
:
true
})
config
.
data
=
qs
.
stringify
(
config
.
data
,
{
skipNulls
:
true
})
}
}
...
...
vite.config.ts
浏览文件 @
acb544f3
...
@@ -29,7 +29,7 @@ export default defineConfig(({ mode }) => ({
...
@@ -29,7 +29,7 @@ export default defineConfig(({ mode }) => ({
changeOrigin
:
true
,
changeOrigin
:
true
,
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
zws/
,
''
)
rewrite
:
path
=>
path
.
replace
(
/^
\/
api
\/
zws/
,
''
)
},
},
'/api'
:
'https://
saas-lab
.ezijing.com'
'/api'
:
'https://
project-center
.ezijing.com'
}
}
},
},
resolve
:
{
resolve
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论