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 fcaa134f
authored
Apr 10, 2023
by
liimin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改配置获取逻辑,刷新不再掉接口获取
1 parent
97927b56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
src/common/constants.js
src/config/index.js
src/views/Login.vue
src/common/constants.js
View file @
fcaa134
...
...
@@ -10,6 +10,7 @@
export
default
{
SCRM_BASE_SESSION
:
'SCRM_BASE_SESSION'
,
SCRM_BASE_MENULIST
:
'SCRM_BASE_MENULIST'
,
SCRM_BASE_CONFIG
:
'SCRM_BASE_CONFIG'
,
SCRM_BASE_FUNCTIONAL_FLAG
:
'function'
,
SCRM_BASE_USERTYPE
:
{
MERCHANT
:
'1'
,
...
...
src/config/index.js
View file @
fcaa134
...
...
@@ -4,17 +4,22 @@
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: limin
* @LastEditTime: 2023-04-10 1
1:47:48
* @LastEditTime: 2023-04-10 1
7:37:40
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
let
cfg
=
require
(
'./conf.js'
)
import
{
Http
}
from
'glsx-common'
import
{
utils
}
from
'glsx-common'
import
{
constants
}
from
'@/common'
const
sw
=
!!+
process
.
env
.
VUE_APP_CONFIG_SWITCH_LOCAL
export
const
fetchConfig
=
(
isEnv
=
sw
)
=>
{
if
(
isEnv
)
{
return
Promise
.
resolve
(
cfg
)
}
const
_config
=
utils
.
storage
.
getSession
(
constants
.
SCRM_BASE_CONFIG
)
if
(
_config
&&
location
.
pathname
!==
'/'
)
{
return
Promise
.
resolve
(
_config
)
}
return
new
Http
({
headers
:
{
refererurl
:
location
.
pathname
},
request
:
{
timeout
:
30000
}
}).
get
(
'https://oss-config.dev.glsx.com.cn/mock/6136bea6ceeb5a5c2bec6950/base/config'
)
}
export
const
config
=
{
...
...
src/views/Login.vue
View file @
fcaa134
...
...
@@ -217,6 +217,7 @@ export default {
sessionData.track = track
this.setSession(sessionData)
this.setTracker(sessionData)
this.storeConfig()
const path = helper.locationPath()
const redirect = path?.get('redirect')
const to = redirect ? `
/
$
{
decodeURIComponent
(
redirect
)}
` : defaultPath
...
...
@@ -294,6 +295,9 @@ export default {
this.error(error.message, ERROR_TYPE.MESSAGE)
}
},
storeConfig() {
utils.storage.setSession(constants.SCRM_BASE_CONFIG, this.$config)
},
...mapActions('app', ['login']),
...mapActions('auth', ['permission', 'setSession']),
...mapActions('track', ['setTracker'])
...
...
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