Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
40e4236a
提交
40e4236a
authored
3月 25, 2019
作者:
YunaiV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
前端:商品分类列表
上级
e9b5adea
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
166 行增加
和
156 行删除
+166
-156
README.md
admin-web/README.md
+6
-2
index.js
admin-web/src/components/GlobalFooter/index.js
+14
-14
defaultSettings.js
admin-web/src/defaultSettings.js
+1
-1
UserLayout.js
admin-web/src/layouts/UserLayout.js
+3
-5
AdminList.js
admin-web/src/pages/Admin/AdminList.js
+6
-4
Login.js
admin-web/src/pages/User/Login.js
+36
-53
document.ejs
admin-web/src/pages/document.ejs
+1
-1
product.js
mobile-web/src/api/product.js
+12
-0
request.js
mobile-web/src/config/request.js
+72
-70
index.vue
mobile-web/src/page/category/index.vue
+0
-0
MVCConfiguration.java
...der/mall/product/application/config/MVCConfiguration.java
+11
-4
UsersProductCategoryController.java
...tion/controller/users/UsersProductCategoryController.java
+4
-2
没有找到文件。
admin-web/README.md
浏览文件 @
40e4236a
...
...
@@ -31,4 +31,8 @@ http://www.tuicool.com/articles/YrQ7j2a
#### 5.注释
1.
route目录下的文件需要加上文件头部注释(写清楚文件是什么功能)
2.
component文件需要加上头部注释 (写清楚改控件的用处)
\ No newline at end of file
2.
component文件需要加上头部注释 (写清楚改控件的用处)
## 补充规范
1.
services 目录中,每个 api 文件,对应后端一个 api 服务。主要考虑是
\ No newline at end of file
admin-web/src/components/GlobalFooter/index.js
浏览文件 @
40e4236a
...
...
@@ -6,20 +6,20 @@ const GlobalFooter = ({ className, links, copyright }) => {
const
clsString
=
classNames
(
styles
.
globalFooter
,
className
);
return
(
<
footer
className
=
{
clsString
}
>
{
links
&&
(
<
div
className
=
{
styles
.
links
}
>
{
links
.
map
(
link
=>
(
<
a
key
=
{
link
.
key
}
title
=
{
link
.
key
}
target
=
{
link
.
blankTarget
?
'_blank'
:
'_self'
}
href
=
{
link
.
href
}
>
{
link
.
title
}
<
/a
>
))
}
<
/div
>
)
}
{
/*{links && (*/
}
{
/*<div className={styles.links}>*/
}
{
/*{links.map(link => (*/
}
{
/*<a*/
}
{
/*key={link.key}*/
}
{
/*title={link.key}*/
}
{
/*target={link.blankTarget ? '_blank' : '_self'}*/
}
{
/*href={link.href}*/
}
{
/*>*/
}
{
/*{link.title}*/
}
{
/*</a>*/
}
{
/*))}*/
}
{
/*</div>*/
}
{
/*)}*/
}
{
copyright
&&
<
div
className
=
{
styles
.
copyright
}
>
{
copyright
}
<
/div>
}
<
/footer
>
);
...
...
admin-web/src/defaultSettings.js
浏览文件 @
40e4236a
...
...
@@ -9,7 +9,7 @@ module.exports = {
menu
:
{
disableLocal
:
false
,
},
title
:
'
Ant Design Pro
'
,
title
:
'
小商城管理平台
'
,
pwa
:
true
,
// your iconfont Symbol Scrip Url
// eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
...
...
admin-web/src/layouts/UserLayout.js
浏览文件 @
40e4236a
...
...
@@ -29,9 +29,7 @@ const links = [
];
const
copyright
=
(
<
Fragment
>
Copyright
<
Icon
type
=
"copyright"
/>
2018
蚂蚁金服体验技术部出品
<
/Fragment
>
<
a
href
=
'https://pc.qq.com/detail/1/detail_2661.html'
>
请使用谷歌浏览器
(
Chrome
)
获取最佳用户体验
<
/a
>
);
class
UserLayout
extends
Component
{
...
...
@@ -63,10 +61,10 @@ class UserLayout extends Component {
<
div
className
=
{
styles
.
header
}
>
<
Link
to
=
"/"
>
<
img
alt
=
"logo"
className
=
{
styles
.
logo
}
src
=
{
logo
}
/
>
<
span
className
=
{
styles
.
title
}
>
后台管理系统
<
/span
>
<
span
className
=
{
styles
.
title
}
>
小商城管理平台
<
/span
>
<
/Link
>
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
TODO
....
<
/div
>
{
/*<div className={styles.desc}>TODO....</div>*/
}
<
/div
>
{
children
}
<
/div
>
...
...
admin-web/src/pages/Admin/AdminList.js
浏览文件 @
40e4236a
...
...
@@ -105,7 +105,7 @@ function List ({ dataSource, loading, pagination, searchParams, dispatch,
<
a
className
=
{
styles
.
tableDelete
}
onClick
=
{()
=>
handleDelete
(
record
)}
>
删除
<
/a
>
<
/span> :
'
'
<
/span> :
nul
l
}
<
/Fragment
>
);
...
...
@@ -379,13 +379,14 @@ const RoleAssignModal = Form.create()(props => {
);
});
@
connect
(({
adminList
,
loading
})
=>
({
@
connect
(({
adminList
})
=>
({
// list: adminList.list,
// pagination: adminList.pagination,
...
adminList
,
loading
:
loading
.
models
.
resourceList
,
}))
// 主界面
@
Form
.
create
()
class
AdminList
extends
PureComponent
{
state
=
{
...
...
@@ -499,4 +500,4 @@ class AdminList extends PureComponent {
}
}
export
default
AdminList
;
export
default
AdminList
;
\ No newline at end of file
admin-web/src/pages/User/Login.js
浏览文件 @
40e4236a
...
...
@@ -108,62 +108,45 @@ class LoginPage extends Component {
}}
/
>
<
/Tab
>
<
Tab
key
=
"mobile"
tab
=
{
formatMessage
({
id
:
'app.login.tab-login-mobile'
})}
>
{
login
.
status
===
'error'
&&
login
.
type
===
'mobile'
&&
!
submitting
&&
this
.
renderMessage
(
formatMessage
({
id
:
'app.login.message-invalid-verification-code'
})
)}
<
Mobile
name
=
"username"
placeholder
=
{
formatMessage
({
id
:
'form.phone-number.placeholder'
})}
rules
=
{[
{
required
:
true
,
message
:
formatMessage
({
id
:
'validation.phone-number.required'
}),
},
{
pattern
:
/^1
\d{10}
$/
,
message
:
formatMessage
({
id
:
'validation.phone-number.wrong-format'
}),
},
]}
/
>
<
Captcha
name
=
"password"
placeholder
=
{
formatMessage
({
id
:
'form.verification-code.placeholder'
})}
countDown
=
{
120
}
onGetCaptcha
=
{
this
.
onGetCaptcha
}
getCaptchaButtonText
=
{
formatMessage
({
id
:
'form.get-captcha'
})}
getCaptchaSecondText
=
{
formatMessage
({
id
:
'form.captcha.second'
})}
rules
=
{[
{
required
:
true
,
message
:
formatMessage
({
id
:
'validation.verification-code.required'
}),
},
]}
/
>
<
/Tab
>
<
div
>
<
Checkbox
checked
=
{
autoLogin
}
onChange
=
{
this
.
changeAutoLogin
}
>
<
FormattedMessage
id
=
"app.login.remember-me"
/>
<
/Checkbox
>
<
a
style
=
{{
float
:
'right'
}}
href
=
""
>
<
FormattedMessage
id
=
"app.login.forgot-password"
/>
<
/a
>
<
/div
>
{
/*<Tab key="mobile" tab={formatMessage({ id: 'app.login.tab-login-mobile' })}>*/
}
{
/*{login.status === 'error' &&*/
}
{
/*login.type === 'mobile' &&*/
}
{
/*!submitting &&*/
}
{
/*this.renderMessage(*/
}
{
/*formatMessage({ id: 'app.login.message-invalid-verification-code' })*/
}
{
/*)}*/
}
{
/*<Mobile*/
}
{
/*name="username"*/
}
{
/*placeholder={formatMessage({ id: 'form.phone-number.placeholder' })}*/
}
{
/*rules={[*/
}
{
/*{*/
}
{
/*required: true,*/
}
{
/*message: formatMessage({ id: 'validation.phone-number.required' }),*/
}
{
/*},*/
}
{
/*{*/
}
{
/*pattern: /^1\d{10}$/,*/
}
{
/*message: formatMessage({ id: 'validation.phone-number.wrong-format' }),*/
}
{
/*},*/
}
{
/*]}*/
}
{
/*/>*/
}
{
/*<Captcha*/
}
{
/*name="password"*/
}
{
/*placeholder={formatMessage({ id: 'form.verification-code.placeholder' })}*/
}
{
/*countDown={120}*/
}
{
/*onGetCaptcha={this.onGetCaptcha}*/
}
{
/*getCaptchaButtonText={formatMessage({ id: 'form.get-captcha' })}*/
}
{
/*getCaptchaSecondText={formatMessage({ id: 'form.captcha.second' })}*/
}
{
/*rules={[*/
}
{
/*{*/
}
{
/*required: true,*/
}
{
/*message: formatMessage({ id: 'validation.verification-code.required' }),*/
}
{
/*},*/
}
{
/*]}*/
}
{
/*/>*/
}
{
/*</Tab>*/
}
<
Submit
loading
=
{
submitting
}
>
<
FormattedMessage
id
=
"app.login.login"
/>
<
/Submit
>
<
div
className
=
{
styles
.
other
}
>
<
FormattedMessage
id
=
"app.login.sign-in-with"
/>
<
Icon
type
=
"alipay-circle"
className
=
{
styles
.
icon
}
theme
=
"outlined"
/>
<
Icon
type
=
"taobao-circle"
className
=
{
styles
.
icon
}
theme
=
"outlined"
/>
<
Icon
type
=
"weibo-circle"
className
=
{
styles
.
icon
}
theme
=
"outlined"
/>
<
Link
className
=
{
styles
.
register
}
to
=
"/user/register"
>
<
FormattedMessage
id
=
"app.login.signup"
/>
<
/Link
>
<
/div
>
<
/Login
>
<
/div
>
);
...
...
admin-web/src/pages/document.ejs
浏览文件 @
40e4236a
...
...
@@ -7,7 +7,7 @@
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<title>
Ant Design Pro
</title>
<title>
小商城管理平台
</title>
<link
rel=
"icon"
href=
"/favicon.png"
type=
"image/x-icon"
/>
</head>
<body>
...
...
mobile-web/src/api/product.js
0 → 100644
浏览文件 @
40e4236a
import
request
from
"../config/request"
;
export
function
getProductCategoryList
(
pid
)
{
return
request
({
url
:
'product-api/users/category/list'
,
method
:
'get'
,
params
:
{
pid
}
});
}
\ No newline at end of file
mobile-web/src/config/request.js
浏览文件 @
40e4236a
import
axios
from
'axios'
import
{
baseUrl
,
dataSources
}
from
'./env'
;
import
{
baseUrl
,
dataSources
}
from
'./env'
;
import
datas
from
'../data/data'
;
const
service
=
axios
.
create
({
const
service
=
axios
.
create
({
baseURL
:
baseUrl
,
// api 的 base_url
timeout
:
5000
,
// request timeout
});
const
servicef
=
function
(
parameter
){
if
(
dataSources
==
'local'
)
{
const
servicef
=
function
(
parameter
)
{
// debugger;
if
(
dataSources
==
'local'
)
{
//定义回调函数和axios一致
const
promist
=
new
Promise
(
function
(
resolve
,
reject
)
{
var
data
=
datas
[
parameter
.
url
];
if
(
typeof
data
==
'string'
)
{
data
=
JSON
.
parse
(
data
);
}
resolve
(
data
);
const
promist
=
new
Promise
(
function
(
resolve
,
reject
)
{
var
data
=
datas
[
parameter
.
url
];
if
(
typeof
data
==
'string'
)
{
data
=
JSON
.
parse
(
data
);
}
resolve
(
data
);
})
return
promist
;
}
...
...
@@ -26,69 +25,72 @@ const servicef =function(parameter){
}
service
.
interceptors
.
request
.
use
(
config
=>
{
// Do something before request is sent
service
.
interceptors
.
request
.
use
(
config
=>
{
// Do something before request is sent
// if (store.getters.token) {
// // 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
// config.headers['X-Token'] = getToken()
// }
return
config
},
error
=>
{
// Do something with request error
console
.
log
(
error
)
// for debug
Promise
.
reject
(
error
)
}
)
return
config
},
error
=>
{
// Do something with request error
console
.
log
(
error
)
// for debug
Promise
.
reject
(
error
)
}
)
// response interceptor
// response interceptor
service
.
interceptors
.
response
.
use
(
//response => response,
/**
* 下面的注释为通过在response里,自定义code来标示请求状态
* 当code返回如下情况则说明权限有问题,登出并返回到登录页
* 如想通过 xmlhttprequest 来状态码标识 逻辑可写在下面error中
* 以下代码均为样例,请结合自生需求加以修改,若不需要,则可删除
*/
response
=>
{
const
res
=
response
.
data
;
if
(
res
.
ResultCode
!==
200
)
{
// Message({
// message: res.message,
// type: 'error',
// duration: 5 * 1000
// })
// // 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
// if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// // 请自行在引入 MessageBox
// // import { Message, MessageBox } from 'element-ui'
// MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// store.dispatch('FedLogOut').then(() => {
// location.reload() // 为了重新实例化vue-router对象 避免bug
// })
// })
// }
console
.
log
(
1
);
return
Promise
.
reject
(
'error'
)
}
else
{
if
(
typeof
response
.
data
.
Tag
==
'string'
){
return
JSON
.
parse
(
response
.
data
.
Tag
);
}
else
{
return
response
.
data
.
Tag
;
}
}
},
error
=>
{
return
Promise
.
reject
(
error
)
//response => response,
/**
* 下面的注释为通过在response里,自定义code来标示请求状态
* 当code返回如下情况则说明权限有问题,登出并返回到登录页
* 如想通过 xmlhttprequest 来状态码标识 逻辑可写在下面error中
* 以下代码均为样例,请结合自生需求加以修改,若不需要,则可删除
*/
response
=>
{
// debugger;
const
res
=
response
.
data
;
if
(
res
.
code
!==
0
)
{
// Message({
// message: res.message,
// type: 'error',
// duration: 5 * 1000
// })
// // 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
// if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// // 请自行在引入 MessageBox
// // import { Message, MessageBox } from 'element-ui'
// MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
// confirmButtonText: '重新登录',
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// store.dispatch('FedLogOut').then(() => {
// location.reload() // 为了重新实例化vue-router对象 避免bug
// })
// })
// }
console
.
log
(
1
);
return
Promise
.
reject
(
'error'
)
}
else
{
// if (typeof response.data.Tag == 'string') {
// return JSON.parse(response.data.Tag);
// } else {
// return response.data.Tag;
// }
// debugger;
return
res
.
data
;
}
)
},
error
=>
{
return
Promise
.
reject
(
error
)
}
)
export
default
servicef
\ No newline at end of file
export
default
servicef
\ No newline at end of file
mobile-web/src/page/category/index.vue
浏览文件 @
40e4236a
差异被折叠。
点击展开。
product/product-application/src/main/java/cn/iocoder/mall/product/application/config/MVCConfiguration.java
浏览文件 @
40e4236a
...
...
@@ -3,10 +3,7 @@ package cn.iocoder.mall.product.application.config;
import
cn.iocoder.common.framework.config.GlobalExceptionHandler
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Import
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.InterceptorRegistry
;
import
org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.*
;
@EnableWebMvc
@Configuration
...
...
@@ -31,4 +28,13 @@ public class MVCConfiguration implements WebMvcConfigurer {
registry
.
addResourceHandler
(
"webjars/**"
).
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
}
// TODO 芋艿,允许跨域
@Override
public
void
addCorsMappings
(
CorsRegistry
registry
)
{
registry
.
addMapping
(
"/**"
)
.
allowedHeaders
(
"*"
)
.
allowedMethods
(
"*"
)
.
allowedOrigins
(
"*"
);
}
}
\ No newline at end of file
product/product-application/src/main/java/cn/iocoder/mall/product/application/controller/users/UsersProductCategoryController.java
浏览文件 @
40e4236a
package
cn
.
iocoder
.
mall
.
product
.
application
.
controller
.
users
;
import
cn.iocoder.common.framework.vo.CommonResult
;
import
cn.iocoder.mall.product.api.ProductCategoryService
;
import
cn.iocoder.mall.product.api.bo.ProductCategoryBO
;
import
cn.iocoder.mall.product.application.convert.ProductCategoryConvert
;
...
...
@@ -26,9 +27,9 @@ public class UsersProductCategoryController {
@GetMapping
(
"/list"
)
@ApiOperation
(
"获得指定编号下的子分类的数组"
)
@ApiImplicitParam
(
name
=
"pid"
,
value
=
"指定分类编号"
,
required
=
true
,
example
=
"0"
)
public
List
<
UsersProductCategoryVO
>
list
(
@RequestParam
(
"pid"
)
Integer
pid
)
{
public
CommonResult
<
List
<
UsersProductCategoryVO
>
>
list
(
@RequestParam
(
"pid"
)
Integer
pid
)
{
List
<
ProductCategoryBO
>
result
=
productCategoryService
.
getListByPid
(
pid
);
return
ProductCategoryConvert
.
INSTANCE
.
convertToVO
(
result
);
return
CommonResult
.
success
(
ProductCategoryConvert
.
INSTANCE
.
convertToVO
(
result
)
);
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论