Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
micro-portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1951bcf0
authored
Mar 23, 2022
by
张杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化图片展示
1 parent
97390654
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
20 deletions
src/components/Header/Sub/Logo.vue
src/components/HomeContent/Sub/LoginForm.vue
src/main.js
src/store/getters.js
src/store/modules/app.js
src/components/Header/Sub/Logo.vue
View file @
1951bcf
<
template
>
<
template
>
<div
class=
"home-logo-wrapper"
>
<div
class=
"home-logo-wrapper"
>
<!--
<img
class=
"home-logo-img"
src=
"@/assets/images/company-logo.png"
alt=
"company-logo"
>
-->
<!--
<img
class=
"home-logo-img"
src=
"@/assets/images/company-logo.png"
alt=
"company-logo"
>
-->
<img
class=
"home-logo-img"
:src
=
"logoPath"
alt=
"company-logo"
>
<img
class=
"home-logo-img"
:src=
"logoPath"
:key
=
"logoPath"
alt=
"company-logo"
>
<span
class=
"home-logo-title"
>
{{
homeTitle
}}
</span>
<span
class=
"home-logo-title"
>
{{
homeTitle
}}
</span>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
ref
}
from
'vue'
;
import
{
ref
,
watch
,
reactive
,
toRefs
}
from
'vue'
;
import
{
useStore
}
from
"vuex"
;
export
default
{
export
default
{
name
:
'Logo'
,
name
:
'Logo'
,
setup
()
{
setup
()
{
const
homeTitle
=
ref
(
''
);
const
store
=
useStore
();
const
logoPath
=
localStorage
.
getItem
(
'logo'
)
const
data
=
reactive
({
return
{
homeTitle
,
logoPath
};
logoPath
:
store
.
state
.
app
.
logo
,
homeTitle
:
''
})
let
logoPath
=
store
.
state
.
app
.
logo
;
watch
(()
=>
store
.
state
.
app
.
logo
,(
n
,
o
)
=>
{
data
.
logoPath
=
n
;
console
.
log
(
'logoPath:'
,
n
)
})
console
.
log
(
logoPath
)
return
{...
toRefs
(
data
)
};
}
}
}
}
</
script
>
</
script
>
...
@@ -26,7 +35,7 @@
...
@@ -26,7 +35,7 @@
.home-logo-img
{
.home-logo-img
{
//
width
:
480px
;
//
width
:
480px
;
height
:
67px
;
height
:
67px
;
margin-right
:
10px
;
margin-right
:
10px
;
}
}
...
...
src/components/HomeContent/Sub/LoginForm.vue
View file @
1951bcf
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<div
class=
"login-card"
>
<div
class=
"login-card"
>
<!--
<img
class=
"home-logo-img"
src=
"@/assets/images/company-logo.png"
alt=
"company-logo"
>
-->
<!--
<img
class=
"home-logo-img"
src=
"@/assets/images/company-logo.png"
alt=
"company-logo"
>
-->
<div>
<div>
<img
class=
"home-logo-img"
:src=
"logo"
alt=
"company-logo"
/>
<img
class=
"home-logo-img"
:src=
"logo"
:key=
"logo"
alt=
"company-logo"
/>
</div>
</div>
<h1
class=
"login-title"
>
{{
title
}}
</h1>
<h1
class=
"login-title"
>
{{
title
}}
</h1>
<div
v-if=
"showAlert"
>
<div
v-if=
"showAlert"
>
...
@@ -53,6 +53,8 @@ import {
...
@@ -53,6 +53,8 @@ import {
getCurrentInstance
,
getCurrentInstance
,
computed
,
computed
,
onBeforeMount
,
onBeforeMount
,
watch
,
ref
,
}
from
"vue"
;
}
from
"vue"
;
import
{
useStore
}
from
"vuex"
;
import
{
useStore
}
from
"vuex"
;
import
{
useRouter
}
from
"vue-router"
;
import
{
useRouter
}
from
"vue-router"
;
...
@@ -78,7 +80,8 @@ export default {
...
@@ -78,7 +80,8 @@ export default {
password
:
""
,
password
:
""
,
captcha
:
""
,
captcha
:
""
,
},
},
title
:
localStorage
.
getItem
(
"title"
),
title
:
store
.
state
.
app
.
title
,
logo
:
store
.
state
.
app
.
logo
,
});
});
const
{
ctx
:
_this
}
=
getCurrentInstance
();
const
{
ctx
:
_this
}
=
getCurrentInstance
();
const
loginService
=
new
LoginService
();
const
loginService
=
new
LoginService
();
...
@@ -176,13 +179,21 @@ export default {
...
@@ -176,13 +179,21 @@ export default {
// getCaptcha();
// getCaptcha();
// }, 1000, true);
// }, 1000, true);
const
logo
=
localStorage
.
getItem
(
"logo"
);
//const logo = localStorage.getItem("logo");
// const title = localStorage.getItem("title");
watch
(
()
=>
store
.
state
.
app
.
logo
,
(
n
,
o
)
=>
{
state
.
logo
=
n
;
}
);
watch
(()
=>
store
.
state
.
app
.
title
,(
n
,
o
)
=>
{
state
.
title
=
n
})
return
{
return
{
...
toRefs
(
state
),
...
toRefs
(
state
),
handleSubmit
,
handleSubmit
,
logo
,
//title,
//title,
// updateCaptcha
// updateCaptcha
};
};
...
...
src/main.js
View file @
1951bcf
...
@@ -19,7 +19,10 @@ const getConfig = (url = URL + '/e-sheild-portal-config') => {
...
@@ -19,7 +19,10 @@ const getConfig = (url = URL + '/e-sheild-portal-config') => {
console
.
log
(
o
)
console
.
log
(
o
)
localStorage
.
setItem
(
'logo'
,
o
.
logo
)
localStorage
.
setItem
(
'logo'
,
o
.
logo
)
localStorage
.
setItem
(
'title'
,
o
.
title
)
localStorage
.
setItem
(
'title'
,
o
.
title
)
localStorage
.
setItem
(
'smallLogo'
,
o
.
smallLogo
)
localStorage
.
setItem
(
'smallLogo'
,
o
.
smallLogo
)
store
.
commit
(
'app/SET_LOGIN_LOGO'
,
o
.
logo
)
store
.
commit
(
'app/SET_LOGIN_TITLE'
,
o
.
title
)
store
.
commit
(
'app/SET_MENU_LOGO'
,
o
.
smallLogo
)
// window.localStorage.setItem(
// window.localStorage.setItem(
// 'GLSX_COMMODITY_CENTER_CONFIG',
// 'GLSX_COMMODITY_CENTER_CONFIG',
// xhr.responseText,
// xhr.responseText,
...
...
src/store/getters.js
View file @
1951bcf
...
@@ -13,7 +13,10 @@ const getters = {
...
@@ -13,7 +13,10 @@ const getters = {
updateMenu
:
state
=>
state
.
menu
.
updateMenu
,
updateMenu
:
state
=>
state
.
menu
.
updateMenu
,
curMenuAuth
:
state
=>
state
.
menu
.
curMenuAuth
,
curMenuAuth
:
state
=>
state
.
menu
.
curMenuAuth
,
fileUploadURL
:
state
=>
state
.
app
.
fileUploadURL
,
fileUploadURL
:
state
=>
state
.
app
.
fileUploadURL
,
menuList
:
state
=>
state
.
menu
.
menuList
menuList
:
state
=>
state
.
menu
.
menuList
,
logo
:
state
=>
state
.
app
.
logo
,
title
:
state
=>
state
.
app
.
title
,
smallLogo
:
state
=>
state
.
app
.
smallLogo
}
}
export
default
getters
;
export
default
getters
;
\ No newline at end of file
\ No newline at end of file
src/store/modules/app.js
View file @
1951bcf
...
@@ -10,20 +10,23 @@ let state = {
...
@@ -10,20 +10,23 @@ let state = {
commonData
:
{
commonData
:
{
showEmpty
:
false
showEmpty
:
false
},
},
fullscreen
:
false
fullscreen
:
false
,
logo
:
''
,
title
:
''
,
smallLogo
:
''
};
};
try
{
try
{
const
userInfoStorage
=
localStorage
.
getItem
(
'userInfo'
),
const
userInfoStorage
=
localStorage
.
getItem
(
'userInfo'
),
token
=
localStorage
.
getItem
(
'token'
),
token
=
localStorage
.
getItem
(
'token'
),
baseURL
=
localStorage
.
getItem
(
'BASE_URL'
);
baseURL
=
localStorage
.
getItem
(
'BASE_URL'
);
if
(
userInfoStorage
)
{
if
(
userInfoStorage
)
{
state
.
userInfo
=
JSON
.
parse
(
userInfoStorage
);
state
.
userInfo
=
JSON
.
parse
(
userInfoStorage
);
}
}
if
(
token
)
{
if
(
token
)
{
state
.
token
=
token
;
state
.
token
=
token
;
}
}
if
(
baseURL
)
{
if
(
baseURL
)
{
state
.
baseURL
=
baseURL
;
state
.
baseURL
=
baseURL
;
}
}
}
catch
(
error
)
{
}
catch
(
error
)
{
...
@@ -40,7 +43,7 @@ export default {
...
@@ -40,7 +43,7 @@ export default {
SET_MENU_PATH_ARR
(
state
,
data
)
{
SET_MENU_PATH_ARR
(
state
,
data
)
{
state
.
menuPathArr
=
data
;
state
.
menuPathArr
=
data
;
},
},
SET_COMMON_DATA
(
state
,
data
)
{
SET_COMMON_DATA
(
state
,
data
)
{
state
.
commonData
=
data
;
state
.
commonData
=
data
;
},
},
// 设置token
// 设置token
...
@@ -62,9 +65,25 @@ export default {
...
@@ -62,9 +65,25 @@ export default {
SET_FULLSCREEN
(
state
,
data
)
{
SET_FULLSCREEN
(
state
,
data
)
{
state
.
fullscreen
=
data
;
state
.
fullscreen
=
data
;
},
},
SET_UPLOADFILE_PATH
(
state
,
data
)
{
SET_UPLOADFILE_PATH
(
state
,
data
)
{
state
.
fileUploadURL
=
data
;
state
.
fileUploadURL
=
data
;
},
// 设置登录页面logo
SET_LOGIN_LOGO
(
state
,
data
)
{
state
.
logo
=
data
;
},
// 设置登录页面title
SET_LOGIN_TITLE
(
state
,
data
)
{
state
.
title
=
data
;
},
// 设置内页小logo
SET_MENU_LOGO
(
state
,
data
)
{
state
.
smallLogo
=
data
;
}
}
},
},
actions
:
{
actions
:
{
// 更新接口地址
// 更新接口地址
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment