Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
9
912project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
CRS
912project
Commits
2e3bc05f
提交
2e3bc05f
authored
3月 10, 2020
作者:
CRS
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nwe
上级
15ae2122
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
20 行增加
和
1 行删除
+20
-1
login.vue
src/components/login/login.vue
+3
-0
axios.js
src/services/axios.js
+3
-0
action.js
src/store/action.js
+6
-0
getter.js
src/store/getter.js
+4
-1
mutation.js
src/store/mutation.js
+3
-0
state.js
src/store/state.js
+1
-0
没有找到文件。
src/components/login/login.vue
浏览文件 @
2e3bc05f
...
@@ -42,6 +42,9 @@ export default {
...
@@ -42,6 +42,9 @@ export default {
console
.
log
(
res
.
data
.
data
)
console
.
log
(
res
.
data
.
data
)
this
.
$store
.
commit
(
'changeUserData'
,
res
.
data
.
data
);
this
.
$store
.
commit
(
'changeUserData'
,
res
.
data
.
data
);
this
.
$router
.
push
({
name
:
'firstHome'
})
this
.
$router
.
push
({
name
:
'firstHome'
})
this
.
$store
.
commit
(
'changeSession'
,
{
// 存值
session
:
res
.
data
.
data
.
sessionId
});
}
else
{
}
else
{
this
.
$message
.
error
(
res
.
data
.
msg
);
this
.
$message
.
error
(
res
.
data
.
msg
);
}
}
...
...
src/services/axios.js
浏览文件 @
2e3bc05f
import
axios
from
'axios'
;
import
axios
from
'axios'
;
// import Qs from 'qs';
// import Qs from 'qs';
import
baseUrl
from
'../../config'
;
import
baseUrl
from
'../../config'
;
import
store
from
'../store'
;
// axios.defaults.withCredentials = true;
// axios.defaults.withCredentials = true;
// 添加请求拦截器
// 添加请求拦截器
axios
.
interceptors
.
request
.
use
(
function
(
config
)
{
axios
.
interceptors
.
request
.
use
(
function
(
config
)
{
// console.log(store.getters.getSession.session)
config
.
headers
.
session
=
store
.
getters
.
getSession
.
session
;
// 预处理请求信息(config 发出的数据) 下方是三种请求,李迪凡的
// 预处理请求信息(config 发出的数据) 下方是三种请求,李迪凡的
if
(
config
.
method
===
'post'
||
config
.
method
===
'put'
||
config
.
method
===
'delete'
)
{
if
(
config
.
method
===
'post'
||
config
.
method
===
'put'
||
config
.
method
===
'delete'
)
{
// POST传参序列化
// POST传参序列化
...
...
src/store/action.js
浏览文件 @
2e3bc05f
...
@@ -30,6 +30,12 @@ const actions = {
...
@@ -30,6 +30,12 @@ const actions = {
jumpOther
:
payload
jumpOther
:
payload
})
})
},
},
changeSession
(
store
,
payload
)
{
store
.
commit
({
type
:
'changeSession'
,
session
:
payload
})
},
};
};
export
default
actions
;
export
default
actions
;
src/store/getter.js
浏览文件 @
2e3bc05f
...
@@ -14,7 +14,10 @@ const getters = {
...
@@ -14,7 +14,10 @@ const getters = {
},
},
getJumpOther
(
state
)
{
getJumpOther
(
state
)
{
return
state
.
jumpOther
return
state
.
jumpOther
}
},
getSession
(
state
)
{
return
state
.
session
},
};
};
export
default
getters
;
export
default
getters
;
src/store/mutation.js
浏览文件 @
2e3bc05f
...
@@ -15,6 +15,9 @@ const mutations = {
...
@@ -15,6 +15,9 @@ const mutations = {
changeJumpOther
(
state
,
payload
)
{
changeJumpOther
(
state
,
payload
)
{
state
.
jumpOther
=
payload
;
state
.
jumpOther
=
payload
;
},
},
changeSession
(
state
,
payload
)
{
state
.
session
=
payload
;
},
};
};
export
default
mutations
;
export
default
mutations
;
src/store/state.js
浏览文件 @
2e3bc05f
...
@@ -5,6 +5,7 @@ const state = {
...
@@ -5,6 +5,7 @@ const state = {
homeClick
:
{},
// 首页点击的模块
homeClick
:
{},
// 首页点击的模块
nowPath
:
''
,
// 当前页面路径
nowPath
:
''
,
// 当前页面路径
jumpOther
:
''
,
// 跳转到其他页面,修改顶部子菜单样式
jumpOther
:
''
,
// 跳转到其他页面,修改顶部子菜单样式
session
:
''
,
// 请求session
};
};
export
default
state
;
export
default
state
;
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论