Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
78945c61
提交
78945c61
authored
3月 04, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 处理未 mock 情况需要处理的 api 数据,暂时后不需要提供这些 api
上级
171cf5b9
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
87 行增加
和
19 行删除
+87
-19
app.js
admin-web/src/app.js
+16
-12
authRoutesData.js
admin-web/src/mock-data/authRoutesData.js
+6
-0
currentUserData.js
admin-web/src/mock-data/currentUserData.js
+56
-0
user.js
admin-web/src/models/user.js
+5
-3
Login.js
admin-web/src/pages/User/Login.js
+2
-0
api.js
admin-web/src/services/api.js
+2
-4
没有找到文件。
admin-web/src/app.js
浏览文件 @
78945c61
import
fetch
from
'dva/fetch'
;
// import fetch from 'dva/fetch';
import
getAuthRoutesData
from
'./mock-data/authRoutesData'
;
export
const
dva
=
{
config
:
{
...
...
@@ -30,15 +31,18 @@ export function patchRoutes(routes) {
}
export
function
render
(
oldRender
)
{
fetch
(
'/api/auth_routes'
)
.
then
(
res
=>
res
.
json
())
.
then
(
ret
=>
{
authRoutes
=
ret
;
oldRender
();
},
()
=>
{
oldRender
();
}
);
// fetch('/api/auth_routes')
// .then(res => res.json())
// .then(
// ret => {
// authRoutes = ret;
// oldRender();
// },
// () => {
// oldRender();
// }
// );
authRoutes
=
getAuthRoutesData
;
oldRender
();
}
admin-web/src/mock-data/authRoutesData.js
0 → 100644
浏览文件 @
78945c61
function
getAuthRoutesData
()
{
// return {authority: ['admin', 'user']}
return
{
authority
:
[
'guest'
]
};
}
export
default
getAuthRoutesData
();
admin-web/src/mock-data/currentUserData.js
0 → 100644
浏览文件 @
78945c61
// TODO 临时使用,后台暂时无接口
function
getCurrentUser
()
{
return
{
name
:
'Serati Ma'
,
avatar
:
'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png'
,
userid
:
'00000001'
,
email
:
'antdesign@alipay.com'
,
signature
:
'海纳百川,有容乃大'
,
title
:
'交互专家'
,
group
:
'蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED'
,
tags
:
[
{
key
:
'0'
,
label
:
'很有想法的'
,
},
{
key
:
'1'
,
label
:
'专注设计'
,
},
{
key
:
'2'
,
label
:
'辣~'
,
},
{
key
:
'3'
,
label
:
'大长腿'
,
},
{
key
:
'4'
,
label
:
'川妹子'
,
},
{
key
:
'5'
,
label
:
'海纳百川'
,
},
],
notifyCount
:
12
,
unreadCount
:
11
,
country
:
'China'
,
geographic
:
{
province
:
{
label
:
'浙江省'
,
key
:
'330000'
,
},
city
:
{
label
:
'杭州市'
,
key
:
'330100'
,
},
},
address
:
'西湖区工专路 77 号'
,
phone
:
'0752-268888888'
,
};
}
export
default
getCurrentUser
();
admin-web/src/models/user.js
浏览文件 @
78945c61
import
{
query
as
queryUsers
,
queryCurrent
}
from
'@/services/user'
;
import
{
query
as
queryUsers
}
from
'@/services/user'
;
import
currentUserData
from
'../mock-data/currentUserData'
;
export
default
{
namespace
:
'user'
,
...
...
@@ -16,8 +17,9 @@ export default {
payload
:
response
,
});
},
*
fetchCurrent
(
_
,
{
call
,
put
})
{
const
response
=
yield
call
(
queryCurrent
);
*
fetchCurrent
(
_
,
{
put
})
{
// const response = yield call(queryCurrent);
const
response
=
currentUserData
;
yield
put
({
type
:
'saveCurrentUser'
,
payload
:
response
,
...
...
admin-web/src/pages/User/Login.js
浏览文件 @
78945c61
...
...
@@ -84,6 +84,7 @@ class LoginPage extends Component {
<
UserName
name
=
"username"
placeholder
=
{
`
${
formatMessage
({
id
:
'app.login.userName'
})}
: admin or user`
}
defaultValue
=
"admin"
rules
=
{[
{
required
:
true
,
...
...
@@ -94,6 +95,7 @@ class LoginPage extends Component {
<
Password
name
=
"password"
placeholder
=
{
`
${
formatMessage
({
id
:
'app.login.password'
})}
: admin`
}
defaultValue
=
"nicai"
rules
=
{[
{
required
:
true
,
...
...
admin-web/src/services/api.js
浏览文件 @
78945c61
...
...
@@ -104,16 +104,14 @@ export async function updateFakeList(params) {
}
export
async
function
fakeAccountLogin
(
params
)
{
return
request
(
`/admin-api/admin/passport/login
/
?
${
stringify
(
params
)}
`
,
{
return
request
(
`/admin-api/admin/passport/login?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
body
:
params
,
});
}
export
async
function
fakeRegister
(
params
)
{
return
request
(
`/admin-api/admin/passport/login
/
?
${
stringify
(
params
)}
`
,
{
return
request
(
`/admin-api/admin/passport/login?
${
stringify
(
params
)}
`
,
{
method
:
'POST'
,
body
:
params
,
});
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论