Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
project-prototype
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
耿迪迪
project-prototype
Commits
d3e9ec5e
Commit
d3e9ec5e
authored
Nov 24, 2021
by
纪泽龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
默认值换成你
parent
6d61c297
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
5 deletions
+22
-5
package.json
projectname-web/package.json
+3
-2
user.js
projectname-web/src/store/modules/user.js
+9
-1
index.vue
projectname-web/src/views/index.vue
+4
-0
index.vue
projectname-web/src/views/system/setting/index.vue
+5
-1
vue.config.js
projectname-web/vue.config.js
+1
-1
No files found.
projectname-web/package.json
View file @
d3e9ec5e
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
"@riophae/vue-treeselect"
:
"0.4.0"
,
"@riophae/vue-treeselect"
:
"0.4.0"
,
"axios"
:
"0.21.0"
,
"axios"
:
"0.21.0"
,
"clipboard"
:
"2.0.6"
,
"clipboard"
:
"2.0.6"
,
"core-js"
:
"
3.8
.1"
,
"core-js"
:
"
^3.19
.1"
,
"echarts"
:
"4.9.0"
,
"echarts"
:
"4.9.0"
,
"element-ui"
:
"2.15.0"
,
"element-ui"
:
"2.15.0"
,
"file-saver"
:
"2.0.4"
,
"file-saver"
:
"2.0.4"
,
...
@@ -80,5 +80,6 @@
...
@@ -80,5 +80,6 @@
"browserslist"
:
[
"browserslist"
:
[
"> 1%"
,
"> 1%"
,
"last 2 versions"
"last 2 versions"
]
],
"main"
:
"index.js"
}
}
projectname-web/src/store/modules/user.js
View file @
d3e9ec5e
...
@@ -7,7 +7,8 @@ const user = {
...
@@ -7,7 +7,8 @@ const user = {
name
:
''
,
name
:
''
,
avatar
:
''
,
avatar
:
''
,
roles
:
[],
roles
:
[],
permissions
:
[]
permissions
:
[],
systemSetting
:{},
},
},
mutations
:
{
mutations
:
{
...
@@ -25,6 +26,9 @@ const user = {
...
@@ -25,6 +26,9 @@ const user = {
},
},
SET_PERMISSIONS
:
(
state
,
permissions
)
=>
{
SET_PERMISSIONS
:
(
state
,
permissions
)
=>
{
state
.
permissions
=
permissions
state
.
permissions
=
permissions
},
SET_SYSTEMSETTING
:
(
state
,
systemSetting
)
=>
{
state
.
systemSetting
=
systemSetting
}
}
},
},
...
@@ -52,6 +56,7 @@ const user = {
...
@@ -52,6 +56,7 @@ const user = {
getInfo
().
then
(
res
=>
{
getInfo
().
then
(
res
=>
{
const
user
=
res
.
user
const
user
=
res
.
user
const
avatar
=
user
.
avatar
==
""
?
require
(
"@/assets/images/profile.jpg"
)
:
process
.
env
.
VUE_APP_BASE_API
+
user
.
avatar
;
const
avatar
=
user
.
avatar
==
""
?
require
(
"@/assets/images/profile.jpg"
)
:
process
.
env
.
VUE_APP_BASE_API
+
user
.
avatar
;
console
.
log
(
"getInfo"
)
if
(
res
.
roles
&&
res
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
if
(
res
.
roles
&&
res
.
roles
.
length
>
0
)
{
// 验证返回的roles是否是一个非空数组
commit
(
'SET_ROLES'
,
res
.
roles
)
commit
(
'SET_ROLES'
,
res
.
roles
)
commit
(
'SET_PERMISSIONS'
,
res
.
permissions
)
commit
(
'SET_PERMISSIONS'
,
res
.
permissions
)
...
@@ -60,6 +65,9 @@ const user = {
...
@@ -60,6 +65,9 @@ const user = {
}
}
commit
(
'SET_NAME'
,
user
.
userName
)
commit
(
'SET_NAME'
,
user
.
userName
)
commit
(
'SET_AVATAR'
,
avatar
)
commit
(
'SET_AVATAR'
,
avatar
)
// 默认配置
commit
(
'SET_SYSTEMSETTING'
,
res
.
systemSetting
)
console
.
log
(
res
.
systemSetting
)
resolve
(
res
)
resolve
(
res
)
}).
catch
(
error
=>
{
}).
catch
(
error
=>
{
reject
(
error
)
reject
(
error
)
...
...
projectname-web/src/views/index.vue
View file @
d3e9ec5e
...
@@ -569,6 +569,10 @@ export default {
...
@@ -569,6 +569,10 @@ export default {
version
:
"3.5.0"
,
version
:
"3.5.0"
,
};
};
},
},
created
(){
// 默认配置
console
.
log
(
this
.
$store
.
state
.
settings
)
},
methods
:
{
methods
:
{
goTarget
(
href
)
{
goTarget
(
href
)
{
window
.
open
(
href
,
"_blank"
);
window
.
open
(
href
,
"_blank"
);
...
...
projectname-web/src/views/system/setting/index.vue
View file @
d3e9ec5e
...
@@ -280,7 +280,6 @@ export default {
...
@@ -280,7 +280,6 @@ export default {
this
.
open
=
false
;
this
.
open
=
false
;
this
.
getList
();
this
.
getList
();
//刷新运行参数缓存
//刷新运行参数缓存
this
.
refreshSystemSetting
();
});
});
}
}
}
}
...
@@ -297,7 +296,9 @@ export default {
...
@@ -297,7 +296,9 @@ export default {
return
delSetting
(
systemIds
);
return
delSetting
(
systemIds
);
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
getList
();
this
.
getList
();
this
.
refreshSystemSetting
();
this
.
msgSuccess
(
"删除成功"
);
this
.
msgSuccess
(
"删除成功"
);
}).
catch
(()
=>
{});
}).
catch
(()
=>
{});
},
},
/** 导出按钮操作 */
/** 导出按钮操作 */
...
@@ -320,6 +321,9 @@ export default {
...
@@ -320,6 +321,9 @@ export default {
console
.
log
(
response
,
"fdsfsdfdsfd"
)
console
.
log
(
response
,
"fdsfsdfdsfd"
)
if
(
response
.
code
!=
200
){
if
(
response
.
code
!=
200
){
this
.
message
(
"运行参数缓存刷新失败,请重新刷新缓存!"
);
this
.
message
(
"运行参数缓存刷新失败,请重新刷新缓存!"
);
}
else
{
this
.
$store
.
commit
(
"SET_SYSTEMSETTING"
,
response
.
data
)
console
.
log
(
this
.
$store
.
state
.
user
.
systemSetting
)
}
}
});
});
}
}
...
...
projectname-web/vue.config.js
View file @
d3e9ec5e
...
@@ -34,7 +34,7 @@ module.exports = {
...
@@ -34,7 +34,7 @@ module.exports = {
proxy
:
{
proxy
:
{
// detail: https://cli.vuejs.org/config/#devserver-proxy
// detail: https://cli.vuejs.org/config/#devserver-proxy
[
process
.
env
.
VUE_APP_BASE_API
]:
{
[
process
.
env
.
VUE_APP_BASE_API
]:
{
target
:
`http://
localhost
:8080`
,
target
:
`http://
192.168.2.28
:8080`
,
changeOrigin
:
true
,
changeOrigin
:
true
,
pathRewrite
:
{
pathRewrite
:
{
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
[
'^'
+
process
.
env
.
VUE_APP_BASE_API
]:
''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment