Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
5
59110440259
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
senior-prj-62
59110440259
Commits
3783f660
Commit
3783f660
authored
Feb 06, 2020
by
Piyaphorn Arphornsri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Data
parent
994792a7
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
425 additions
and
210 deletions
+425
-210
index.js
Backend/controllers/auth/index.js
+12
-9
index.js
Backend/controllers/list/index.js
+15
-0
index.js
Backend/controllers/shop/index.js
+16
-0
index.js
Backend/models/beauticianImg/index.js
+8
-7
index.js
Backend/models/booking/index.js
+21
-10
index.js
Backend/models/list/index.js
+10
-7
index.js
Backend/models/promotion/index.js
+10
-7
index.js
Backend/models/reviews/index.js
+14
-10
index.js
Backend/models/shop/index.js
+18
-11
index.js
Backend/models/shopimage/index.js
+8
-7
index.js
Backend/models/user/index.js
+11
-1
index.js
Backend/models/userShopOwner/index.js
+0
-29
index.js
Backend/models/userbeautician/index.js
+0
-32
index.js
Backend/routers/auth/index.js
+8
-6
index.js
Backend/routers/index.js
+6
-1
index.js
Backend/routers/list/index.js
+8
-0
index.js
Backend/routers/shop/index.js
+8
-0
server.js
Backend/server.js
+2
-0
logo192.png
b_beauty_project/public/logo192.png
+0
-0
logo512.png
b_beauty_project/public/logo512.png
+0
-0
index.js
b_beauty_project/src/components/AppBra/index.js
+36
-6
index.js
b_beauty_project/src/components/AppHeader/index.js
+41
-29
index.js
b_beauty_project/src/views/HomePage/index.js
+18
-9
index.js
b_beauty_project/src/views/RigisterPage/index.js
+58
-12
index.js
b_beauty_project/src/views/RigisterShopPage/index.js
+97
-17
No files found.
Backend/controllers/auth/index.js
View file @
3783f660
...
@@ -35,7 +35,10 @@ exports.register = async (req, res) => {
...
@@ -35,7 +35,10 @@ exports.register = async (req, res) => {
const
newUser
=
await
User
.
create
({
const
newUser
=
await
User
.
create
({
name
:
registerData
.
name
,
name
:
registerData
.
name
,
email
:
registerData
.
email
,
email
:
registerData
.
email
,
password
:
passwordHash
password
:
passwordHash
,
address
:
registerData
.
address
,
tel
:
registerData
.
tel
,
role
:
registerData
.
role
});
});
const
token
=
await
createToken
(
newUser
.
id
);
const
token
=
await
createToken
(
newUser
.
id
);
res
.
status
(
200
).
send
(
"success"
);
res
.
status
(
200
).
send
(
"success"
);
...
@@ -50,8 +53,8 @@ exports.login = async (req, res) => {
...
@@ -50,8 +53,8 @@ exports.login = async (req, res) => {
const
user
=
await
User
.
findOne
({
const
user
=
await
User
.
findOne
({
where
:
{
email
:
loginData
.
email
}
where
:
{
email
:
loginData
.
email
}
});
});
if
(
!
U
ser
)
{
if
(
!
u
ser
)
{
return
res
.
status
(
400
).
json
({
message
:
"รหัสผ่านไม่ถูกต้อง"
});
return
res
.
status
(
400
).
json
({
message
:
"
email หรือ
รหัสผ่านไม่ถูกต้อง"
});
}
else
{
}
else
{
const
chkPassword
=
await
bcryptjs
.
compare
(
const
chkPassword
=
await
bcryptjs
.
compare
(
loginData
.
password
,
loginData
.
password
,
...
@@ -61,15 +64,16 @@ exports.login = async (req, res) => {
...
@@ -61,15 +64,16 @@ exports.login = async (req, res) => {
return
res
.
status
(
400
).
json
({
message
:
"รหัสผ่านไม่ถูกต้อง"
});
return
res
.
status
(
400
).
json
({
message
:
"รหัสผ่านไม่ถูกต้อง"
});
}
}
const
token
=
await
createToken
(
user
.
dataValues
.
id
);
const
token
=
await
createToken
(
user
.
dataValues
.
id
);
res
.
status
(
200
).
json
({
success
})
res
.
status
(
200
).
send
(
"success"
);
}
}
};
};
exports
.
currentUser
=
async
(
req
,
res
)
=>
{
exports
.
currentUser
=
async
(
req
,
res
)
=>
{
const
token
=
req
.
headers
.
token
;
const
token
=
req
.
headers
.
token
;
const
decode
=
await
JWT
.
verify
(
token
,
config
.
JWT_SECRET
)
const
decode
=
await
JWT
.
verify
(
token
,
config
.
JWT_SECRET
)
;
const
user
=
await
User
.
findOne
({
const
user
=
await
User
.
findOne
({
where
:
{
where
:
{
id
:
decode
.
id
id
:
decode
.
id
}
}
})
});
}
};
\ No newline at end of file
Backend/controllers/list/index.js
0 → 100644
View file @
3783f660
const
List
=
require
(
"../../models/list"
);
const
config
=
require
(
"../../config"
);
createToken
=
id
=>
{
return
JWT
.
sign
({
id
},
config
.
JWT_SECRET
);
};
exports
.
list
=
async
(
req
,
res
)
=>
{
try
{
const
listData
=
req
.
body
;
List
.
create
(
listData
);
}
catch
(
err
)
{
console
.
log
(
err
);
res
.
sendStatus
(
401
);
}
};
Backend/controllers/shop/index.js
0 → 100644
View file @
3783f660
const
Shop
=
require
(
"../../models/shop"
);
const
config
=
require
(
"../../config"
);
createToken
=
id
=>
{
return
JWT
.
sign
({
id
},
config
.
JWT_SECRET
);
};
exports
.
Shop
=
async
(
req
,
res
)
=>
{
try
{
const
shopData
=
req
.
body
;
Shop
.
create
(
shopData
);
}
catch
(
err
){
console
.
log
(
err
);
res
.
sendStatus
(
401
);
}
};
Backend/models/
user
beauticianImg/index.js
→
Backend/models/beauticianImg/index.js
View file @
3783f660
const
Sequelize
=
require
(
"sequelize"
);
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"beauticianImage"
,
{
module
.
exports
=
db
.
sequelize
.
define
(
"beauticianImage
s
"
,
{
beauticianImgID
:
{
id
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
beauticianImgPic
:
{
image
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
TEXT
},
},
userbeauticianImgID
:
{
beautician
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
"users"
,
referencesKey
:
"id"
}
}
});
});
Backend/models/booking/index.js
View file @
3783f660
const
Sequelize
=
require
(
"sequelize"
);
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"booking"
,
{
module
.
exports
=
db
.
sequelize
.
define
(
"booking
s
"
,
{
bookingID
:
{
id
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
userID
:
{
user
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
'users'
,
referencesKey
:
'id'
},
shop
:
{
type
:
Sequelize
.
INTEGER
,
references
:
'shops'
,
referencesKey
:
'id'
},
},
shopID
:
{
list
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
'lists'
,
referencesKey
:
'id'
},
},
listID
:
{
beautician
:{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
'users'
,
referencesKey
:
'id'
},
},
bookingD
ete
:
{
d
ete
:
{
type
:
Sequelize
.
DATE
type
:
Sequelize
.
DATE
},
},
bookingT
ime
:
{
t
ime
:
{
type
:
Sequelize
.
TIME
type
:
Sequelize
.
TIME
}
}
});
});
Backend/models/list/index.js
View file @
3783f660
const
Sequelize
=
require
(
"sequelize"
);
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"list"
,
{
module
.
exports
=
db
.
sequelize
.
define
(
"list
s
"
,
{
listID
:
{
id
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
slistN
ame
:
{
n
ame
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
list
price
:
{
price
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
},
},
listT
ime
:
{
t
ime
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
},
},
shopID
:
{
shop
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
'shops'
,
referencesKey
:
'id'
}
}
});
});
Backend/models/promotion/index.js
View file @
3783f660
const
Sequelize
=
require
(
"sequelize"
);
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"promotion"
,
{
module
.
exports
=
db
.
sequelize
.
define
(
"promotion
s
"
,
{
promotionID
:
{
id
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
promotionD
ete
:
{
d
ete
:
{
type
:
Sequelize
.
DATE
type
:
Sequelize
.
DATE
},
},
shopID
:
{
type
:
Sequelize
.
INTEGER
detail
:
{
},
promotionDetail
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
shop
:
{
type
:
Sequelize
.
INTEGER
,
references
:
'shops'
,
referencesKey
:
'id'
}
}
});
});
Backend/models/reviews/index.js
View file @
3783f660
...
@@ -2,28 +2,32 @@ const Sequelize = require("sequelize");
...
@@ -2,28 +2,32 @@ const Sequelize = require("sequelize");
const
db
=
require
(
"../../db"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"reviwes"
,
{
module
.
exports
=
db
.
sequelize
.
define
(
"reviwes"
,
{
reviewsID
:
{
id
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
reviewsT
opic
:
{
t
opic
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
},
},
reviewsM
essage
:
{
m
essage
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
reviewsP
oint
:
{
p
oint
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
},
},
reviewsPic
:
{
image
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
TEXT
},
},
shopID
:
{
shop
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
'shops'
,
referencesKey
:
'id'
},
},
userID
:
{
user
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
'users'
,
referencesKey
:
'id'
}
}
});
});
Backend/models/shop/index.js
View file @
3783f660
const
Sequelize
=
require
(
"sequelize"
);
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"shop"
,
{
module
.
exports
=
db
.
sequelize
.
define
(
"shop
s
"
,
{
shopID
:
{
id
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
shopN
ame
:
{
n
ame
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
},
},
shopT
imeopen
:
{
t
imeopen
:
{
type
:
Sequelize
.
TIME
type
:
Sequelize
.
TIME
},
},
shopTimeC
lose
:
{
timec
lose
:
{
type
:
Sequelize
.
TIME
type
:
Sequelize
.
TIME
},
},
shopA
ddress
:
{
a
ddress
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
shopT
el
:
{
t
el
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
shopD
etial
:
{
d
etial
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
shopM
ap
:
{
m
ap
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
shopType
:
{
type
:
{
type
:
Sequelize
.
ENUM
(
'สปาและนวด'
,
'ผิวหน้า'
,
'ขนตาและคิ้ว'
,
'ทำเล็บ'
,
'ชาลอน'
,
'แต่งหน้าทำผม'
)
type
:
Sequelize
.
ENUM
(
"สปาและนวด"
,
"ผิวหน้า"
,
"ขนตาและคิ้ว"
,
"ทำเล็บ"
,
"ชาลอน"
,
"แต่งหน้าทำผม"
)
}
}
});
});
Backend/models/shopimage/index.js
View file @
3783f660
const
Sequelize
=
require
(
"sequelize"
);
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"shopimage"
,
{
module
.
exports
=
db
.
sequelize
.
define
(
"shopimage
s
"
,
{
shopImageID
:
{
id
:
{
type
:
Sequelize
.
INTEGER
,
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
primaryKey
:
true
,
autoIncrement
:
true
autoIncrement
:
true
},
},
shopImagePic
:
{
image
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
TEXT
},
},
shopID
:
{
shop
:
{
type
:
Sequelize
.
INTEGER
type
:
Sequelize
.
INTEGER
,
references
:
'shops'
,
referencesKey
:
'id'
}
}
});
});
Backend/models/user/index.js
View file @
3783f660
...
@@ -18,8 +18,17 @@ module.exports = db.sequelize.define(
...
@@ -18,8 +18,17 @@ module.exports = db.sequelize.define(
password
:
{
password
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
photo
:
{
address
:
{
type
:
Sequelize
.
STRING
},
tel
:
{
type
:
Sequelize
.
STRING
type
:
Sequelize
.
STRING
},
},
photo
:
{
type
:
Sequelize
.
TEXT
},
role
:
{
type
:
Sequelize
.
INTEGER
}
},
},
);
);
\ No newline at end of file
Backend/models/userShopOwner/index.js
deleted
100644 → 0
View file @
994792a7
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"usersShopOwner"
,
{
userShopOwnerID
:
{
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
userShopOwnerName
:
{
type
:
Sequelize
.
INTEGER
},
userShopOwnerEmail
:
{
type
:
Sequelize
.
STRING
},
userShopOwnerPassword
:
{
type
:
Sequelize
.
STRING
},
userShopOwnerAddress
:
{
type
:
Sequelize
.
STRING
},
userShoppownerTel
:
{
type
:
Sequelize
.
STRING
},
userShopOwnerPic
:
{
type
:
Sequelize
.
STRING
}
});
Backend/models/userbeautician/index.js
deleted
100644 → 0
View file @
994792a7
const
Sequelize
=
require
(
"sequelize"
);
const
db
=
require
(
"../../db"
);
module
.
exports
=
db
.
sequelize
.
define
(
"userbeautician"
,
{
userbeauticianID
:
{
type
:
Sequelize
.
INTEGER
,
primaryKey
:
true
,
autoIncrement
:
true
},
userbeauticianName
:
{
type
:
Sequelize
.
INTEGER
},
userbeauticianEmail
:
{
type
:
Sequelize
.
STRING
},
userbeauticianPassword
:
{
type
:
Sequelize
.
STRING
},
userbeauticianAddres
:
{
type
:
Sequelize
.
STRING
},
userbeauticianTel
:
{
type
:
Sequelize
.
STRING
},
shopID
:
{
type
:
Sequelize
.
STRING
},
userbeauticianPic
:
{
type
:
Sequelize
.
STRING
}
});
Backend/routers/auth/index.js
View file @
3783f660
const
express
=
require
(
'express'
);
const
express
=
require
(
"express"
);
const
router
=
express
.
Router
();
const
router
=
express
.
Router
();
const
authController
=
require
(
'../../controllers/auth'
);
const
authController
=
require
(
"../../controllers/auth"
);
router
.
get
(
'/get'
,
(
req
,
res
)
=>
{
router
.
get
(
"/get"
,
(
req
,
res
)
=>
{
res
.
json
({
"test"
:
"Test get"
});
res
.
json
({
test
:
"Test get"
});
});
});
router
.
get
(
'/getUserById/:id'
,
authController
.
getUserById
);
router
.
get
(
"/getUserById/:id"
,
authController
.
getUserById
);
router
.
post
(
"/register"
,
authController
.
register
);
router
.
post
(
"/login"
,
authController
.
login
);
router
.
post
(
'/register'
,
authController
.
register
);
module
.
exports
=
router
;
module
.
exports
=
router
;
Backend/routers/index.js
View file @
3783f660
const
auth
=
require
(
'./auth'
);
const
auth
=
require
(
'./auth'
);
const
list
=
require
(
'./list'
);
const
shop
=
require
(
'./shop'
)
module
.
exports
=
{
module
.
exports
=
{
auth
auth
,
list
,
shop
,
}
}
\ No newline at end of file
Backend/routers/list/index.js
0 → 100644
View file @
3783f660
const
express
=
require
(
"express"
);
const
router
=
express
.
Router
();
const
authController
=
require
(
"../../controllers/list"
);
router
.
post
(
"/list"
,
authController
.
list
);
module
.
exports
=
router
;
Backend/routers/shop/index.js
0 → 100644
View file @
3783f660
const
express
=
require
(
"express"
);
const
router
=
express
.
Router
();
const
authController
=
require
(
"../../controllers/shop"
);
router
.
post
(
"/shop"
,
authController
.
shop
);
module
.
exports
=
router
;
Backend/server.js
View file @
3783f660
...
@@ -10,6 +10,8 @@ app.use(cors());
...
@@ -10,6 +10,8 @@ app.use(cors());
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
false
}))
app
.
use
(
'/api/auth'
,
router
.
auth
);
app
.
use
(
'/api/auth'
,
router
.
auth
);
app
.
use
(
'/api/list'
,
router
.
list
);
app
.
use
(
'/api/shop'
,
router
.
shop
);
app
.
listen
(
port
,
()
=>
{
app
.
listen
(
port
,
()
=>
{
console
.
log
(
'Express server listening on port '
+
port
)
console
.
log
(
'Express server listening on port '
+
port
)
...
...
b_beauty_project/public/logo192.png
View replaced file @
994792a7
View file @
3783f660
5.22 KB
|
W:
|
H:
2.93 KB
|
W:
|
H:
2-up
Swipe
Onion skin
b_beauty_project/public/logo512.png
View replaced file @
994792a7
View file @
3783f660
9.44 KB
|
W:
|
H:
2.93 KB
|
W:
|
H:
2-up
Swipe
Onion skin
b_beauty_project/src/components/AppBra/index.js
View file @
3783f660
...
@@ -11,6 +11,10 @@ import SupervisedUserCircleOutlinedIcon from "@material-ui/icons/SupervisedUserC
...
@@ -11,6 +11,10 @@ import SupervisedUserCircleOutlinedIcon from "@material-ui/icons/SupervisedUserC
import
MapIcon
from
"@material-ui/icons/MapOutlined"
;
import
MapIcon
from
"@material-ui/icons/MapOutlined"
;
import
compose
from
"recompose/compose"
;
import
compose
from
"recompose/compose"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
SpaIcon
from
'@material-ui/icons/Spa'
;
import
FaceIcon
from
'@material-ui/icons/Face'
;
import
RemoveRedEyeIcon
from
'@material-ui/icons/RemoveRedEye'
;
import
PanToolIcon
from
'@material-ui/icons/PanTool'
;
const
styles
=
theme
=>
({
const
styles
=
theme
=>
({
root
:
{
root
:
{
...
@@ -65,13 +69,15 @@ class Dashboard extends Component {
...
@@ -65,13 +69,15 @@ class Dashboard extends Component {
>
>
<
Tab
<
Tab
label
=
"สปาและนวด"
label
=
"สปาและนวด"
icon
=
{
icon
=
{
<
Badge
<
Badge
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
//badgeContent={badgeOrder}
//badgeContent={badgeOrder}
color
=
"secondary"
color
=
"secondary"
>
>
<
ShoppingBasket
/>
<
SpaIcon
/>
<
/Badge
>
<
/Badge
>
}
}
className
=
{
classes
.
flex
}
className
=
{
classes
.
flex
}
...
@@ -84,7 +90,7 @@ class Dashboard extends Component {
...
@@ -84,7 +90,7 @@ class Dashboard extends Component {
//badgeContent={badgeUser}
//badgeContent={badgeUser}
color
=
"secondary"
color
=
"secondary"
>
>
<
AccountCircle
/>
<
FaceIcon
/>
<
/Badge
>
<
/Badge
>
}
}
className
=
{
classes
.
flex
}
className
=
{
classes
.
flex
}
...
@@ -97,24 +103,48 @@ class Dashboard extends Component {
...
@@ -97,24 +103,48 @@ class Dashboard extends Component {
//badgeContent={badgeCredit}
//badgeContent={badgeCredit}
color
=
"secondary"
color
=
"secondary"
>
>
<
CreditCard
/>
<
RemoveRedEyeIcon
/>
<
/Badge
>
<
/Badge
>
}
}
className
=
{
classes
.
flex
}
className
=
{
classes
.
flex
}
/
>
/
>
<
Tab
<
Tab
label
=
"ทำเล็บ"
label
=
"ทำเล็บ"
icon
=
{
<
SupervisedUserCircleOutlinedIcon
/>
}
icon
=
{
<
Badge
className
=
{
classes
.
margin
}
//badgeContent={badgeCredit}
color
=
"secondary"
>
<
PanToolIcon
/>
<
/Badge
>
}
className
=
{
classes
.
flex
}
className
=
{
classes
.
flex
}
/
>
/
>
<
Tab
<
Tab
label
=
"ชาลอน"
label
=
"ชาลอน"
icon
=
{
<
LiveHelpIcon
/>
}
icon
=
{
<
Badge
className
=
{
classes
.
margin
}
//badgeContent={badgeCredit}
color
=
"secondary"
>
<
FaceIcon
/>
<
/Badge
>
}
className
=
{
classes
.
flex
}
className
=
{
classes
.
flex
}
/
>
/
>
<
Tab
<
Tab
label
=
"แต่งหน้าทำผม"
label
=
"แต่งหน้าทำผม"
icon
=
{
<
HelpIcon
/>
}
icon
=
{
<
Badge
className
=
{
classes
.
margin
}
//badgeContent={badgeCredit}
color
=
"secondary"
>
<
FaceIcon
/>
<
/Badge
>
}
className
=
{
classes
.
flex
}
className
=
{
classes
.
flex
}
/
>
/
>
<
/Tabs
>
<
/Tabs
>
...
...
b_beauty_project/src/components/AppHeader/index.js
View file @
3783f660
import
React
from
'react'
;
import
React
,
{
Component
}
from
"react"
;
import
{
makeStyles
}
from
'@material-ui/core/styles'
;
import
{
withRouter
}
from
"react-router-dom"
;
import
AppBar
from
'@material-ui/core/AppBar'
;
import
compose
from
"recompose/compose"
;
import
Toolbar
from
'@material-ui/core/Toolbar'
;
import
{
withStyles
}
from
"@material-ui/core/styles"
;
import
Typography
from
'@material-ui/core/Typography'
;
import
Button
from
'@material-ui/core/Button'
;
import
AppBar
from
"@material-ui/core/AppBar"
;
import
IconButton
from
'@material-ui/core/IconButton'
;
import
Toolbar
from
"@material-ui/core/Toolbar"
;
import
MenuIcon
from
'@material-ui/icons/Menu'
;
import
Typography
from
"@material-ui/core/Typography"
;
import
Button
from
"@material-ui/core/Button"
;
const
useStyles
=
makeStyles
(
theme
=>
({
import
IconButton
from
"@material-ui/core/IconButton"
;
import
MenuIcon
from
"@material-ui/icons/Menu"
;
const
styles
=
theme
=>
({
root
:
{
root
:
{
flexGrow
:
1
,
flexGrow
:
1
},
},
menuButton
:
{
menuButton
:
{
marginRight
:
theme
.
spacing
(
2
)
,
marginRight
:
theme
.
spacing
(
2
)
},
},
title
:
{
title
:
{
flexGrow
:
1
,
flexGrow
:
1
}
,
}
})
)
;
});
class
AppHeader
extends
Component
{
export
default
function
ButtonAppBa
r
()
{
rende
r
()
{
const
classes
=
useStyles
()
;
const
{
classes
}
=
this
.
props
;
return
(
return
(
<
div
className
=
{
classes
.
root
}
>
<
div
className
=
{
classes
.
root
}
>
<
AppBar
position
=
"static"
>
<
AppBar
position
=
"static"
>
<
Toolbar
>
<
Toolbar
>
<
IconButton
edge
=
"start"
className
=
{
classes
.
menuButton
}
color
=
"inherit"
aria
-
label
=
"menu"
Link
href
=
"/"
>
<
IconButton
edge
=
"start"
className
=
{
classes
.
menuButton
}
color
=
"inherit"
aria
-
label
=
"menu"
Link
href
=
"/"
>
B
Beauty
B
Beauty
<
/IconButton
>
<
/IconButton
>
<
Typography
variant
=
"h6"
className
=
{
classes
.
title
}
>
<
Typography
variant
=
"h6"
className
=
{
classes
.
title
}
><
/Typography
>
<
Button
color
=
"inherit"
Link
href
=
"/LoginPage"
>
<
/Typography
>
Login
<
Button
color
=
"inherit"
Link
href
=
"/LoginPage"
>
Login
<
/Button
>
<
/Button
>
<
Button
color
=
"inherit"
Link
href
=
"/RigisterPage"
>
rigister
<
/Button
>
<
Button
color
=
"inherit"
Link
href
=
"/RigisterPage"
>
<
Button
color
=
"inherit"
Link
href
=
"/RigisterShopPage"
>
rigistershop
<
/Button
>
rigister
<
/Button
>
<
Button
color
=
"inherit"
Link
href
=
"/RigisterShopPage"
>
rigistershop
<
/Button
>
<
/Toolbar
>
<
/Toolbar
>
<
/AppBar
>
<
/AppBar
>
<
/div
>
<
/div
>
);
);
}
}
}
export
default
compose
(
withStyles
(
styles
),
withRouter
)(
AppHeader
);
b_beauty_project/src/views/HomePage/index.js
View file @
3783f660
...
@@ -69,6 +69,16 @@ class HomePage extends Component {
...
@@ -69,6 +69,16 @@ class HomePage extends Component {
open
:
false
open
:
false
});
});
};
};
handleClickOpen2
=
()
=>
{
this
.
setState
({
open
:
true
});
};
handleClose2
=
()
=>
{
this
.
setState
({
open
:
false
});
};
componentDidMount
=
()
=>
{
componentDidMount
=
()
=>
{
let
{
pathname
}
=
this
.
props
.
location
;
let
{
pathname
}
=
this
.
props
.
location
;
...
@@ -172,7 +182,7 @@ class HomePage extends Component {
...
@@ -172,7 +182,7 @@ class HomePage extends Component {
<
img
<
img
src
=
"https://www.smeleader.com/wp-content/uploads/2018/05/%E0%B9%81%E0%B8%9F%E0%B8%A3%E0%B8%99%E0%B9%84%E0%B8%8A%E0%B8%AA%E0%B9%8C%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%99%E0%B9%80%E0%B8%AA%E0%B8%A3%E0%B8%B4%E0%B8%A1%E0%B8%AA%E0%B8%A7%E0%B8%A2-%E0%B8%A3%E0%B8%A7%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%A3%E0%B8%99%E0%B8%94%E0%B9%8C%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%99%E0%B8%8B%E0%B8%B2%E0%B8%A5%E0%B8%AD%E0%B8%99-%E0%B8%AA%E0%B8%B2%E0%B8%99%E0%B8%9D%E0%B8%B1%E0%B8%99%E0%B8%98%E0%B8%B8%E0%B8%A3%E0%B8%81%E0%B8%B4%E0%B8%88%E0%B8%97%E0%B8%A3%E0%B8%87%E0%B8%9C%E0%B8%A1.jpg"
src
=
"https://www.smeleader.com/wp-content/uploads/2018/05/%E0%B9%81%E0%B8%9F%E0%B8%A3%E0%B8%99%E0%B9%84%E0%B8%8A%E0%B8%AA%E0%B9%8C%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%99%E0%B9%80%E0%B8%AA%E0%B8%A3%E0%B8%B4%E0%B8%A1%E0%B8%AA%E0%B8%A7%E0%B8%A2-%E0%B8%A3%E0%B8%A7%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%A3%E0%B8%99%E0%B8%94%E0%B9%8C%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%99%E0%B8%8B%E0%B8%B2%E0%B8%A5%E0%B8%AD%E0%B8%99-%E0%B8%AA%E0%B8%B2%E0%B8%99%E0%B8%9D%E0%B8%B1%E0%B8%99%E0%B8%98%E0%B8%B8%E0%B8%A3%E0%B8%81%E0%B8%B4%E0%B8%88%E0%B8%97%E0%B8%A3%E0%B8%87%E0%B8%9C%E0%B8%A1.jpg"
width
=
"70%"
width
=
"70%"
><
/img
>
/
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -185,9 +195,7 @@ class HomePage extends Component {
...
@@ -185,9 +195,7 @@ class HomePage extends Component {
<
/div
>
<
/div
>
<
div
className
=
"row"
>
<
div
className
=
"row"
>
<
h4
>
<
h4
>
โปรโมชั่น
:
จองคิวผ่าน
B
Beauty
ลด
5
%<
/h4
>
โปรโมชั่น
:
จองคิวผ่าน
B
Beauty
ลด
5
%
<
/h4
>
<
/div
>
<
/div
>
<
div
className
=
"row"
>
<
div
className
=
"row"
>
...
@@ -237,18 +245,19 @@ class HomePage extends Component {
...
@@ -237,18 +245,19 @@ class HomePage extends Component {
/
>
/
>
<
/DialogContent
>
<
/DialogContent
>
<
DialogActions
>
<
DialogActions
>
<
Button
onClick
=
{
this
.
handleClose
}
color
=
"primary"
>
<
Button
variant
=
"outlined"
onClick
=
{
this
.
handleClose
}
color
=
"primary"
>
Disagree
ยกเลิก
<
/Button
>
<
/Button
>
<
Button
<
Button
onClick
=
{
this
.
handleClose
}
variant
=
"outlined"
color
=
"primary"
color
=
"primary"
autoFocus
onClick
=
{
this
.
handleClickOpen
}
>
>
Agree
ถัดไป
<
/Button
>
<
/Button
>
<
/DialogActions
>
<
/DialogActions
>
<
/Dialog
>
<
/Dialog
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
...
b_beauty_project/src/views/RigisterPage/index.js
View file @
3783f660
...
@@ -10,6 +10,8 @@ import AddPhotoAlternateIcon from "@material-ui/icons/AddPhotoAlternate";
...
@@ -10,6 +10,8 @@ import AddPhotoAlternateIcon from "@material-ui/icons/AddPhotoAlternate";
import
MailOutlineIcon
from
"@material-ui/icons/MailOutline"
;
import
MailOutlineIcon
from
"@material-ui/icons/MailOutline"
;
import
VpnKeyIcon
from
"@material-ui/icons/VpnKey"
;
import
VpnKeyIcon
from
"@material-ui/icons/VpnKey"
;
import
Button
from
"@material-ui/core/Button"
;
import
Button
from
"@material-ui/core/Button"
;
import
ContactPhoneIcon
from
"@material-ui/icons/ContactPhone"
;
import
BusinessIcon
from
"@material-ui/icons/Business"
;
import
axios
from
"axios"
;
import
axios
from
"axios"
;
...
@@ -28,7 +30,10 @@ class RegisterPage extends Component {
...
@@ -28,7 +30,10 @@ class RegisterPage extends Component {
email
:
""
,
email
:
""
,
password
:
""
,
password
:
""
,
password2
:
""
,
password2
:
""
,
image
:
""
address
:
""
,
tel
:
""
,
image
:
""
,
rolr
:
"0"
};
};
handleChange
=
event
=>
{
handleChange
=
event
=>
{
...
@@ -38,20 +43,21 @@ class RegisterPage extends Component {
...
@@ -38,20 +43,21 @@ class RegisterPage extends Component {
this
.
setState
({
this
.
setState
({
[
event
.
target
.
name
]:
event
.
target
.
value
[
event
.
target
.
name
]:
event
.
target
.
value
});
});
// this.setState({
// name: name,
// email: email,
// password: password,
// password2: password2,
// image: image
// });
};
};
render
()
{
render
()
{
const
{
classes
}
=
this
.
props
;
const
{
classes
}
=
this
.
props
;
// const { } = this.state;
// const { } = this.state;
const
{
name
,
email
,
password
,
password2
,
image
}
=
this
.
state
;
const
{
name
,
email
,
password
,
password2
,
address
,
tel
,
image
,
role
}
=
this
.
state
;
return
(
return
(
<
div
className
=
"row center"
>
<
div
className
=
"row center"
>
<
h2
>
ลงทะเบียน
<
/h2
>
<
h2
>
ลงทะเบียน
<
/h2
>
...
@@ -132,6 +138,43 @@ class RegisterPage extends Component {
...
@@ -132,6 +138,43 @@ class RegisterPage extends Component {
/
>
/
>
<
/div
>
<
/div
>
<
br
><
/br
>
<
br
><
/br
>
<
div
>
<
TextField
className
=
{
classes
.
margin
}
id
=
"address"
name
=
"address"
value
=
{
address
}
label
=
"ที่อยู่"
autoComplete
=
"address"
variant
=
"outlined"
InputProps
=
{{
startAdornment
:
(
<
InputAdornment
position
=
"start"
>
<
BusinessIcon
/>
<
/InputAdornment
>
)
}}
onChange
=
{
this
.
handleChange
}
/
>
<
TextField
className
=
{
classes
.
margin
}
id
=
"tel"
name
=
"tel"
value
=
{
tel
}
label
=
"เบอร์โทร"
autoComplete
=
"Phone number"
variant
=
"outlined"
InputProps
=
{{
startAdornment
:
(
<
InputAdornment
position
=
"start"
>
<
ContactPhoneIcon
/>
<
/InputAdornment
>
)
}}
onChange
=
{
this
.
handleChange
}
/
>
<
/div
>
<
br
><
/br
>
<
div
>
<
div
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
...
@@ -168,7 +211,10 @@ class RegisterPage extends Component {
...
@@ -168,7 +211,10 @@ class RegisterPage extends Component {
email
:
email
,
email
:
email
,
password
:
password
,
password
:
password
,
name
:
name
,
name
:
name
,
image
:
image
image
:
image
,
address
:
address
,
tel
:
tel
,
role
:
role
})
})
.
then
(
response
=>
{
.
then
(
response
=>
{
console
.
log
(
"สร้างผู้ใช้สำเร็จ"
,
response
);
console
.
log
(
"สร้างผู้ใช้สำเร็จ"
,
response
);
...
@@ -179,7 +225,7 @@ class RegisterPage extends Component {
...
@@ -179,7 +225,7 @@ class RegisterPage extends Component {
});
});
// alert("ลงทะเบียนสำเร็จ");
// alert("ลงทะเบียนสำเร็จ");
}
else
{
}
else
{
alert
(
"password ไม่
ตรงกันโว๊ยยยย
"
);
alert
(
"password ไม่
ถูกต้อง
"
);
}
}
}}
}}
>
>
...
...
b_beauty_project/src/views/RigisterShopPage/index.js
View file @
3783f660
import
React
,
{
Component
}
from
"react"
;
import
React
,
{
Component
}
from
"react"
;
import
{
withStyles
}
from
"@material-ui/core/styles"
;
import
{
withStyles
}
from
"@material-ui/core/styles"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
{
Input
,
InputLabel
}
from
"@material-ui/core"
;
import
compose
from
"recompose/compose"
;
import
Input
from
"@material-ui/core/Input"
;
import
InputLabel
from
"@material-ui/core/InputLabel"
;
import
InputAdornment
from
"@material-ui/core/InputAdornment"
;
import
InputAdornment
from
"@material-ui/core/InputAdornment"
;
import
FormControl
from
"@material-ui/core/FormControl"
;
import
FormControl
from
"@material-ui/core/FormControl"
;
import
TextField
from
"@material-ui/core/TextField"
;
import
TextField
from
"@material-ui/core/TextField"
;
...
@@ -13,20 +10,54 @@ import AddPhotoAlternateIcon from "@material-ui/icons/AddPhotoAlternate";
...
@@ -13,20 +10,54 @@ import AddPhotoAlternateIcon from "@material-ui/icons/AddPhotoAlternate";
import
MailOutlineIcon
from
"@material-ui/icons/MailOutline"
;
import
MailOutlineIcon
from
"@material-ui/icons/MailOutline"
;
import
VpnKeyIcon
from
"@material-ui/icons/VpnKey"
;
import
VpnKeyIcon
from
"@material-ui/icons/VpnKey"
;
import
Button
from
"@material-ui/core/Button"
;
import
Button
from
"@material-ui/core/Button"
;
import
TextareaAutosize
from
"@material-ui/core/TextareaAutosize"
;
import
ContactPhoneIcon
from
"@material-ui/icons/ContactPhone"
;
import
ContactPhoneIcon
from
"@material-ui/icons/ContactPhone"
;
import
BusinessIcon
from
"@material-ui/icons/Business"
;
import
BusinessIcon
from
"@material-ui/icons/Business"
;
import
axios
from
"axios"
;
import
{
withRouter
}
from
"react-router-dom"
;
import
compose
from
"recompose/compose"
;
const
styles
=
theme
=>
({
const
styles
=
theme
=>
({
margin
:
{
margin
:
{
margin
:
theme
.
spacing
(
1
)
margin
:
theme
.
spacing
(
1
)
}
}
});
});
class
Registershop
extends
Component
{
class
RegisterShopPage
extends
Component
{
state
=
{
name
:
""
,
email
:
""
,
password
:
""
,
password2
:
""
,
address
:
""
,
tel
:
""
,
image
:
""
,
rolr
:
"1"
};
handleChange
=
event
=>
{
console
.
log
(
"name : "
,
event
.
target
.
name
);
console
.
log
(
"value : "
,
event
.
target
.
value
);
this
.
setState
({
[
event
.
target
.
name
]:
event
.
target
.
value
});
};
render
()
{
render
()
{
const
{
classes
}
=
this
.
props
;
const
{
classes
}
=
this
.
props
;
// const { } = this.state;
const
{
name
,
email
,
password
,
password2
,
address
,
tel
,
image
,
role
}
=
this
.
state
;
return
(
return
(
<
div
className
=
"row center"
>
<
div
className
=
"row center"
>
<
h2
>
ลงทะเบียนธุรกิจ
<
/h2
>
<
h2
>
ลงทะเบียนธุรกิจ
<
/h2
>
...
@@ -34,8 +65,10 @@ class Registershop extends Component {
...
@@ -34,8 +65,10 @@ class Registershop extends Component {
<
div
>
<
div
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
id
=
"outlined-uncontrolled"
id
=
"name"
label
=
"ชื่อร้าน"
name
=
"name"
value
=
{
name
}
label
=
"ชื่อ-สกุล"
variant
=
"outlined"
variant
=
"outlined"
InputProps
=
{{
InputProps
=
{{
startAdornment
:
(
startAdornment
:
(
...
@@ -44,11 +77,14 @@ class Registershop extends Component {
...
@@ -44,11 +77,14 @@ class Registershop extends Component {
<
/InputAdornment
>
<
/InputAdornment
>
)
)
}}
}}
onChange
=
{
this
.
handleChange
}
/
>
/
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
id
=
"outlined-uncontrolled"
id
=
"email"
name
=
"email"
value
=
{
email
}
label
=
"E_mail"
label
=
"E_mail"
variant
=
"outlined"
variant
=
"outlined"
InputProps
=
{{
InputProps
=
{{
...
@@ -58,13 +94,16 @@ class Registershop extends Component {
...
@@ -58,13 +94,16 @@ class Registershop extends Component {
<
/InputAdornment
>
<
/InputAdornment
>
)
)
}}
}}
onChange
=
{
this
.
handleChange
}
/
>
/
>
<
/div
>
<
/div
>
<
br
><
/br
>
<
br
><
/br
>
<
div
>
<
div
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
id
=
"outlined-password-input"
id
=
"password"
name
=
"password"
value
=
{
password
}
label
=
"Password"
label
=
"Password"
type
=
"password"
type
=
"password"
autoComplete
=
"current-password"
autoComplete
=
"current-password"
...
@@ -76,11 +115,14 @@ class Registershop extends Component {
...
@@ -76,11 +115,14 @@ class Registershop extends Component {
<
/InputAdornment
>
<
/InputAdornment
>
)
)
}}
}}
onChange
=
{
this
.
handleChange
}
/
>
/
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
id
=
"outlined-password-input"
id
=
"password2"
name
=
"password2"
value
=
{
password2
}
label
=
"Confirm-Password"
label
=
"Confirm-Password"
type
=
"password"
type
=
"password"
autoComplete
=
"current-password"
autoComplete
=
"current-password"
...
@@ -92,13 +134,16 @@ class Registershop extends Component {
...
@@ -92,13 +134,16 @@ class Registershop extends Component {
<
/InputAdornment
>
<
/InputAdornment
>
)
)
}}
}}
onChange
=
{
this
.
handleChange
}
/
>
/
>
<
/div
>
<
/div
>
<
br
><
/br
>
<
br
><
/br
>
<
div
>
<
div
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
id
=
"outlined-password-input"
id
=
"address"
name
=
"address"
value
=
{
address
}
label
=
"ที่อยู่"
label
=
"ที่อยู่"
autoComplete
=
"address"
autoComplete
=
"address"
variant
=
"outlined"
variant
=
"outlined"
...
@@ -109,10 +154,13 @@ class Registershop extends Component {
...
@@ -109,10 +154,13 @@ class Registershop extends Component {
<
/InputAdornment
>
<
/InputAdornment
>
)
)
}}
}}
onChange
=
{
this
.
handleChange
}
/
>
/
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
id
=
"outlined-password-input"
id
=
"tel"
name
=
"tel"
value
=
{
tel
}
label
=
"เบอร์โทร"
label
=
"เบอร์โทร"
autoComplete
=
"Phone number"
autoComplete
=
"Phone number"
variant
=
"outlined"
variant
=
"outlined"
...
@@ -123,13 +171,16 @@ class Registershop extends Component {
...
@@ -123,13 +171,16 @@ class Registershop extends Component {
<
/InputAdornment
>
<
/InputAdornment
>
)
)
}}
}}
onChange
=
{
this
.
handleChange
}
/
>
/
>
<
/div
>
<
/div
>
<
br
><
/br
>
<
br
><
/br
>
<
div
>
<
div
>
<
TextField
<
TextField
className
=
{
classes
.
margin
}
className
=
{
classes
.
margin
}
id
=
"outlined-file-input"
id
=
"image"
name
=
"image"
value
=
{
image
}
label
=
"เพิ่มรูปภาพ"
label
=
"เพิ่มรูปภาพ"
type
=
"file"
type
=
"file"
autoComplete
=
"current-password"
autoComplete
=
"current-password"
...
@@ -141,6 +192,7 @@ class Registershop extends Component {
...
@@ -141,6 +192,7 @@ class Registershop extends Component {
<
/InputAdornment
>
<
/InputAdornment
>
)
)
}}
}}
onChange
=
{
this
.
handleChange
}
/
>
/
>
<
/div
>
<
/div
>
<
br
><
/br
>
<
br
><
/br
>
...
@@ -149,7 +201,34 @@ class Registershop extends Component {
...
@@ -149,7 +201,34 @@ class Registershop extends Component {
ยกเลิก
ยกเลิก
<
/Button>{" "
}
<
/Button>{" "
}
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
&
nbsp
;
<
Button
variant
=
"contained"
color
=
"primary"
>
<
Button
variant
=
"contained"
color
=
"primary"
onClick
=
{()
=>
{
if
(
password
===
password2
)
{
axios
.
post
(
"http://localhost:9000/api/auth/register"
,
{
email
:
email
,
password
:
password
,
name
:
name
,
image
:
image
,
address
:
address
,
tel
:
tel
,
role
:
role
})
.
then
(
response
=>
{
console
.
log
(
"สร้างผู้ใช้สำเร็จ"
,
response
);
window
.
location
.
href
=
"/"
;
})
.
catch
(
error
=>
{
console
.
log
(
error
);
});
// alert("ลงทะเบียนสำเร็จ");
}
else
{
alert
(
"password ไม่ถูกต้อง"
);
}
}}
>
ลงทะเบียน
ลงทะเบียน
<
/Button
>
<
/Button
>
<
/div
>
<
/div
>
...
@@ -157,4 +236,5 @@ class Registershop extends Component {
...
@@ -157,4 +236,5 @@ class Registershop extends Component {
);
);
}
}
}
}
export
default
compose
(
withStyles
(
styles
),
withRouter
)(
Registershop
);
export
default
compose
(
withStyles
(
styles
),
withRouter
)(
RegisterShopPage
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment