Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
scrm-base
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
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b7f32064
authored
Aug 21, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
新增版本日志功能
1 parent
f9230003
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
99 additions
and
33 deletions
package-lock.json
package.json
src/common/constants.js
src/common/helper.js
src/config/index.js
src/layout/components/NavMenu.vue
src/layout/components/NavUpdateLog.vue
src/layout/components/SubMenu.vue
src/store/modules/app.js
src/store/modules/auth.js
src/views/Login.vue
vue.config.js
package-lock.json
View file @
b7f3206
...
...
@@ -13,6 +13,7 @@
"core-js"
:
"^3.6.5"
,
"element-ui"
:
"^2.15.6"
,
"glsx-common"
:
"^2.1.0"
,
"glsx-common-sdk"
:
"^0.2.7"
,
"gltracker"
:
"^0.1.3"
,
"md5"
:
"^2.3.0"
,
"nprogress"
:
"^0.2.0"
,
...
...
@@ -8244,6 +8245,11 @@
"sha1"
:
"^1.1.1"
}
},
"node_modules/glsx-common-sdk"
:
{
"version"
:
"0.2.7"
,
"resolved"
:
"https://registry.npmjs.org/glsx-common-sdk/-/glsx-common-sdk-0.2.7.tgz"
,
"integrity"
:
"sha512-qwna2x+Pe3KQLYoWFa5dXwBGmwtHMp+t/7vv60rOAaDWRSsx9iShZAZHFguYnSVBf0DTLXkeB32iWy0FgAMXdw=="
},
"node_modules/glsx-common/node_modules/qs"
:
{
"version"
:
"6.11.1"
,
"resolved"
:
"https://registry.npmjs.org/qs/-/qs-6.11.1.tgz"
,
...
...
@@ -26296,6 +26302,11 @@
}
}
},
"glsx-common-sdk"
:
{
"version"
:
"0.2.7"
,
"resolved"
:
"https://registry.npmjs.org/glsx-common-sdk/-/glsx-common-sdk-0.2.7.tgz"
,
"integrity"
:
"sha512-qwna2x+Pe3KQLYoWFa5dXwBGmwtHMp+t/7vv60rOAaDWRSsx9iShZAZHFguYnSVBf0DTLXkeB32iWy0FgAMXdw=="
},
"gltracker"
:
{
"version"
:
"0.1.3"
,
"resolved"
:
"https://registry.npmjs.org/gltracker/-/gltracker-0.1.3.tgz"
,
package.json
View file @
b7f3206
...
...
@@ -14,6 +14,7 @@
"core-js"
:
"^3.6.5"
,
"element-ui"
:
"^2.15.6"
,
"glsx-common"
:
"^2.1.0"
,
"glsx-common-sdk"
:
"^0.2.7"
,
"gltracker"
:
"^0.1.3"
,
"md5"
:
"^2.3.0"
,
"nprogress"
:
"^0.2.0"
,
...
...
src/common/constants.js
View file @
b7f3206
...
...
@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-09-18 09:35:02
* @LastEditors: limin
* @LastEditTime: 2023-0
4-20 16:53:09
* @LastEditTime: 2023-0
6-28 10:02:02
* @FilePath: \scrm-base\src\common\constants.js
*/
export
default
{
...
...
@@ -25,10 +25,11 @@ export default {
CODE
:
'101'
,
MESSAGE
:
'未分配任何子菜单'
}
},
ICONS
:
(()
=>
{
const
iconFiles
=
require
.
context
(
'../assets/images/icons'
,
true
,
/
\.
png$/
)
return
iconFiles
.
keys
().
map
(
iconPath
=>
iconPath
.
replace
(
/^
\.\/(
.*
)\.\w
+$/
,
'$1'
))
})(),
DEFAULT_ICON_NAME
:
'dataview'
}
// ICONS: (() => {
// const iconFiles = require.context('../assets/images/icons', true, /\.png$/)
// return iconFiles.keys().map(iconPath => iconPath.replace(/^\.\/(.*)\.\w+$/, '$1'))
// })(),
// DEFAULT_ICON_NAME: 'dataview',
// SCRM_BASE_UPDATE_LOG_VERSION: 'SCRM_BASE_UPDATE_LOG_CONFIG'
}
src/common/helper.js
View file @
b7f3206
...
...
@@ -7,7 +7,7 @@
* @LastEditTime: 2022-12-19 09:36:48
* @FilePath: \scrm-base\src\common\helper.js
*/
import
constants
from
'./constants'
//
import constants from './constants'
export
function
customized
(
cdn
,
{
assets
,
title
})
{
var
link
=
document
.
querySelector
(
"link[rel*='icon']"
)
||
document
.
createElement
(
'link'
)
link
.
type
=
'image/x-icon'
...
...
@@ -16,10 +16,10 @@ export function customized(cdn, { assets, title }) {
document
.
getElementsByTagName
(
'head'
)[
0
].
appendChild
(
link
)
document
.
title
=
title
}
export
function
getIcon
(
iconName
)
{
const
{
ICONS
,
DEFAULT_ICON_NAME
}
=
constants
return
ICONS
.
includes
(
iconName
)
&&
ICONS
.
includes
(
iconName
+
'-active'
)
?
iconName
:
DEFAULT_ICON_NAME
}
//
export function getIcon(iconName) {
//
const { ICONS, DEFAULT_ICON_NAME } = constants
//
return ICONS.includes(iconName) && ICONS.includes(iconName + '-active') ? iconName : DEFAULT_ICON_NAME
//
}
export
function
locationPath
()
{
return
new
Map
(
location
.
search
...
...
src/config/index.js
View file @
b7f3206
...
...
@@ -4,7 +4,7 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2023-0
6-21 10:42:25
* @LastEditTime: 2023-0
8-15 15:38:09
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let
cfg
=
require
(
'./conf.js'
)
...
...
src/layout/components/NavMenu.vue
View file @
b7f3206
...
...
@@ -26,14 +26,15 @@
<i
class=
"i i-contact"
/>
</el-badge>
</span>
<
span
class=
"nav-text"
>
<
div
class=
"nav-text"
>
<el-popover
placement=
"bottom"
width=
"228"
height=
"316"
trigger=
"click"
>
<NavContact></NavContact>
<a
href=
"javascript:void(0);"
slot=
"reference"
>
联系我们
</a>
</el-popover>
|
<a
href=
"https://www.yuque.com/docs/share/ad640d83-50d9-49cc-a92c-0a5230fedd17"
target=
"blank"
>
营销学院
</a>
</span>
<span
class=
"sprator"
>
|
</span>
<!--
<a
href=
"https://www.yuque.com/docs/share/ad640d83-50d9-49cc-a92c-0a5230fedd17"
target=
"blank"
>
营销学院
</a>
-->
<NavUpdateLog
/>
</div>
</div>
</
template
>
<div
class=
"flex-row flex-items-center"
>
...
...
@@ -119,7 +120,7 @@ export default {
this
.
setCurrent
()
},
methods
:
{
...
mapActions
(
'app'
,
[
'logout'
,
'formatSave'
]),
...
mapActions
(
'app'
,
[
'logout'
,
'formatSave'
,
'setLoading'
]),
...
mapActions
(
'auth'
,
[
'permission'
,
'saveSession'
]),
async
handleCommand
(
command
)
{
if
(
typeof
command
===
'string'
)
{
...
...
@@ -153,6 +154,7 @@ export default {
},
async
logoff
()
{
try
{
this
.
setLoading
(
true
)
await
this
.
logout
()
}
catch
(
error
)
{
console
.
log
({
error
})
...
...
@@ -247,14 +249,19 @@ $tip-color: #666 !important;
height
:
$
header-height
;
background-color
:
#fff
;
@include
leftpadding;
.nav-text,
.nav-text
a
{
font-size
:
14px
;
font-weight
:
500
;
color
:
#3b457f
;
}
.nav-text
{
/deep/.nav-text
{
display
:
flex
;
margin-left
:
2px
;
&,
a,
.sprator
{
font-size
:
14px
;
font-weight
:
500
;
color
:
#3b457f
;
}
.sprator
{
margin
:
0
4px
;
}
&
-avatar
{
margin-left
:
8px
;
overflow
:
hidden
;
...
...
src/layout/components/NavUpdateLog.vue
0 → 100644
View file @
b7f3206
<
template
>
<div
class=
"com-up-log"
>
<a
:href=
"v.link"
target=
"blank"
@
click=
"clickHandler()"
>
更新日志
</a>
<i
class=
"i i-dot"
v-if=
"v.isNew"
></i>
</div>
</
template
>
<
script
>
import
{
Version
}
from
'glsx-common-sdk'
const
version
=
new
Version
({
request
:
{
baseUrl
:
'https://config-center-backend.glsx.com.cn/glsxAdmin/config'
,
isSign
:
false
}
})
export
default
{
name
:
'NavUpdateLog'
,
data
()
{
return
{
v
:
{}
}
},
mounted
()
{
this
.
getUpdateLogCofig
()
},
methods
:
{
async
getUpdateLogCofig
()
{
this
.
v
=
await
version
.
get
({
moduleUrl
:
'scrm-sp'
,
env
:
'update'
})
},
clickHandler
()
{
this
.
v
=
version
.
set
(
this
.
v
.
version
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.com-up-log
{
position
:
relative
;
.i-dot
{
position
:
absolute
;
top
:
-8px
;
right
:
-8px
;
}
}
</
style
>
src/layout/components/SubMenu.vue
View file @
b7f3206
...
...
@@ -74,6 +74,10 @@ export default {
.scrm-base-submenu
{
display
:
flex
;
flex-direction
:
column
;
.i
{
min-width
:
20px
;
min-height
:
20px
;
}
/
deep
/
.el-submenu
{
&:not(.is-opened)
{
margin-bottom
:
$
menu-item-mb
;
...
...
src/store/modules/app.js
View file @
b7f3206
import
{
utils
}
from
'glsx-common'
import
Layout
from
'@/views/Layout'
import
{
constants
,
helper
}
from
'@/common'
import
{
constants
}
from
'@/common'
import
router
from
'@/router'
const
app
=
{
namespaced
:
true
,
...
...
@@ -93,7 +93,7 @@ function formatData(menus, parentMenu) {
if
(
!
path
.
includes
(
'@'
))
continue
;[
entry
,
name
]
=
path
.
split
(
'@'
)
menu
.
entry
=
entry
menu
.
icon
=
helper
.
getIcon
(
name
)
menu
.
icon
=
name
//
helper.getIcon(name)
menu
.
name
=
name
menu
.
id
=
`
${
id
}
`
}
else
{
...
...
src/store/modules/auth.js
View file @
b7f3206
...
...
@@ -31,8 +31,7 @@ const auth = {
async
logout
({
commit
})
{
await
commit
(
'LOGOUT'
)
},
/* eslint-disable */
async
permission
({
dispatch
},
merchant
)
{
async
permission
({},
merchant
)
{
const
{
response
,
productCode
}
=
This
(
'$config'
)
/* eslint-disable */
const
{
sessionId
,
permissionMerchantIds
,
uuid
,
loginList
,
...
merchantItems
}
=
merchant
...
...
src/views/Login.vue
View file @
b7f3206
...
...
@@ -237,12 +237,12 @@ export default {
* 1.获取选择的商户信息
* 2.获取菜单信息并登录
*/
async loginChoose
(merchantId) {
loginChoose: utils.debounce(async function
(merchantId) {
const { response, loginSource } = this.$config
const { userName: loginAccount, loginToken } = this.loginForm
const { code, message, data } = await api.app.choose({ merchantId, loginAccount, loginToken, loginSource })
~[() => this.error(message), () => this._permission(data)][+(code === response.code_success_value)].call()
},
},
2000),
async getCode() {
this.loginForm.code = ''
sessionStorage.clear()
...
...
vue.config.js
View file @
b7f3206
...
...
@@ -98,12 +98,10 @@ module.exports = {
const
templateFunction
=
function
(
data
)
{
var
shared
=
'.i { display: inline-block; vertical-align: middle; background-image: url(I) }'
.
replace
(
'I'
,
data
.
sprites
[
0
].
image
)
var
perSprite
=
data
.
sprites
.
map
(
function
(
sprite
)
{
return
'.i-N { width: Wpx; height: Hpx; background-position: Xpx Ypx; }'
.
replace
(
'N'
,
sprite
.
name
).
replace
(
'W'
,
sprite
.
width
).
replace
(
'H'
,
sprite
.
height
).
replace
(
'X'
,
sprite
.
offset_x
).
replace
(
'Y'
,
sprite
.
offset_y
)
})
.
join
(
'\n'
)
return
shared
+
'\n'
+
perSprite
}
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