Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guyan0319 committed Apr 21, 2020
1 parent 765aceb commit 5930657
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ctrl/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ func Repasswd(c *gin.Context) {
response.ShowError(c,"user_error")
return
}
if userModel.Name=="admin" {
response.ShowError(c, "fail")
return
}
if _, ok := data["password"]; !ok {
response.ShowError(c, "fail")
return
Expand Down
9 changes: 8 additions & 1 deletion data/systemdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- 主机: localhost
-- 生成日期: 2020-04-13 23:20:08
-- 生成日期: 2020-04-21 22:18:48
-- 服务器版本: 8.0.12
-- PHP 版本: 7.3.4

Expand All @@ -28,6 +28,7 @@ SET time_zone = "+00:00";
-- 表的结构 `system_article`
--

DROP TABLE IF EXISTS `system_article`;
CREATE TABLE `system_article` (
`id` bigint(20) UNSIGNED NOT NULL COMMENT '主键',
`author` int(10) NOT NULL DEFAULT '0' COMMENT '作者',
Expand Down Expand Up @@ -60,6 +61,7 @@ INSERT INTO `system_article` (`id`, `author`, `importance`, `status`, `title`, `
-- 表的结构 `system_log`
--

DROP TABLE IF EXISTS `system_log`;
CREATE TABLE `system_log` (
`id` bigint(20) NOT NULL COMMENT '主键',
`system_user_id` int(11) DEFAULT '0' COMMENT '主键',
Expand All @@ -78,6 +80,7 @@ CREATE TABLE `system_log` (
-- 表的结构 `system_menu`
--

DROP TABLE IF EXISTS `system_menu`;
CREATE TABLE `system_menu` (
`id` int(11) NOT NULL COMMENT '主键',
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '名称',
Expand Down Expand Up @@ -122,6 +125,7 @@ INSERT INTO `system_menu` (`id`, `name`, `path`, `component`, `redirect`, `url`,
-- 表的结构 `system_role`
--

DROP TABLE IF EXISTS `system_role`;
CREATE TABLE `system_role` (
`id` int(11) NOT NULL COMMENT '主键',
`name` varchar(100) NOT NULL COMMENT '角色名称',
Expand All @@ -147,6 +151,7 @@ INSERT INTO `system_role` (`id`, `name`, `alias_name`, `description`, `status`,
-- 表的结构 `system_role_menu`
--

DROP TABLE IF EXISTS `system_role_menu`;
CREATE TABLE `system_role_menu` (
`id` int(11) NOT NULL COMMENT '主键',
`system_role_id` int(11) NOT NULL DEFAULT '0' COMMENT '角色主键',
Expand All @@ -159,6 +164,7 @@ CREATE TABLE `system_role_menu` (
-- 表的结构 `system_user`
--

DROP TABLE IF EXISTS `system_user`;
CREATE TABLE `system_user` (
`id` int(11) NOT NULL COMMENT '主键',
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '登录名',
Expand Down Expand Up @@ -191,6 +197,7 @@ INSERT INTO `system_user` (`id`, `name`, `nickname`, `password`, `salt`, `phone`
-- 表的结构 `system_user_role`
--

DROP TABLE IF EXISTS `system_user_role`;
CREATE TABLE `system_user_role` (
`id` int(11) NOT NULL COMMENT '主键',
`system_user_id` int(11) NOT NULL COMMENT '用户主键',
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
github.com/swaggo/gin-swagger v1.2.0
github.com/swaggo/swag v1.6.5
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933 // indirect
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 // indirect
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f // indirect
golang.org/x/tools v0.0.0-20191127201027-ecd32218bd7f // indirect
gopkg.in/go-playground/validator.v9 v9.30.2 // indirect
gopkg.in/yaml.v2 v2.2.7 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 h1:ZBzSG/7F4eNKz2L3GE9o300RX0Az1Bw5HF7PDraD+qU=
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f h1:gWF768j/LaZugp8dyS4UwsslYCYz9XgFxvlgsn0n9H8=
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ func main() {
}
func Load() {
c := conf.Config{}
c.Routes=[]string{"/login","/role/index","/info","/dashboard","/logout"}
c.Routes=[]string{"/ping","/login","/role/index","/info","/dashboard","/logout"}
conf.Set(c)

}
func GetCorsConfig() cors.Config {
config := cors.DefaultConfig()
config.AllowOrigins = []string{"http://localhost:9529","http://localhost:9528","http://localhost:9527","http://localhost"}
config.AllowOrigins = []string{"https://admin.duiniya.com","http://localhost:9529","http://localhost:9528","http://localhost:9527","http://localhost"}
config.AllowMethods = []string{"POST", "GET", "OPTIONS", "PUT", "DELETE"}
config.AllowCredentials = true
config.AllowHeaders = []string{"x-requested-with", "Content-Type", "AccessToken", "X-CSRF-Token","X-Token", "Authorization","token"}
Expand Down

0 comments on commit 5930657

Please sign in to comment.