diff --git a/.gitignore b/.gitignore index 9049e39..60b6201 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ pkg/webui/.vscode/settings.json pkg/webui/package-lock.json pkg/webui/dist/ data/ +config/in-local.yaml +build/ diff --git a/Makefile b/Makefile index e15a601..5724ff8 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,10 @@ build: @echo -e ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>compile server<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" $(BASE_PATH)/scripts/build.sh @echo -e "\n" +pack: + @echo -e ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>pack server and ui<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" + $(BASE_PATH)/scripts/pack.sh + @echo -e "\n" run: @echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>run directly<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" $(shell $(BASE_PATH)/scripts/run.sh) diff --git a/config/in-cluster.yaml b/config/in-cluster.yaml index 57215ac..4c776a5 100644 --- a/config/in-cluster.yaml +++ b/config/in-cluster.yaml @@ -1,30 +1,58 @@ +base: + baseurl: http://localhost:8082/ + isenableaccess: false + isenablecode: false + logpath: /data/log + port: 8082 + sitename: Zeus 宙斯权限后台管理系统 casbin: model: rule_0: config/casbin/rbac_model_0.conf cors: allow_credentials: false allow_headers: - - '*' + - '*' allow_methods: - - GET - - POST - - OPTIONS - - PUT - - DELETE + - GET + - POST + - OPTIONS + - PUT + - DELETE allow_origins: - - '*' + - '*' enable: false max_age: 7200 +database: + driver: mysql + mysql: + charset: utf8 + host: ${MYSQL_HOST}:${MYSQL_PORT} + name: ${MYSQL_DB} + password: ${MYSQL_PASSWORD} + pool: + max: 20 + min: 5 + ssl: false + user: ${MYSQL_USERNAME} + sqlite: + dsn: data/zeus.db dingtalk: + agentid: 310135985 + appkey: dingvgvn9hdcp8qtarno + appsecret: Sn887TtSQgGQNRcSaP-cNQXKYOkuT062vPgHoVvbTm5-HA2qnyew6xbdgZwhxD8N + cachepath: data/ + corpid: dingd60a58f4e3be699235c2f4657eb6378f snsappid: dingoa1uudyxl2dcjvqpij snssecret: o8YvDT5l2zb9dikuCbz0HXOiOaVwdyVResrDVyFaqojv0EwZp8ygAemFyoSBh_lz + ssosecret: XU3oARxOHw731w4LYEJodPEPtppX5oMa7XPp5dv2VjTLak9I--glTDBLLbcl2VpQ domain: bullteam.local email: - from: xxxxxx@qq.com - host: smtp.qq.com - password: xxxxxxxx - port: 25 - username: xxx@qq.com + smtp: + address: ss@163.com + password: xxxxxx + port: 25 + server: smtp.163.com + user: vcoso@163.com jwt: expiresat: 3600*24*1 key: @@ -36,9 +64,9 @@ lang: ldap: addr: 127.0.0.1:389 attributes: - - cn - - displayName - - mail + - cn + - displayName + - mail authfilter: (&(uid=%s)) basedn: dc=bullteam,dc=com binddn: cn=admin,dc=bullteam,dc=com @@ -46,20 +74,13 @@ ldap: starttls: false tls: false userdn: cn=admin,dc=bullteam,dc=com -mode: release -database: - driver: sqlite - sqlite: - dsn: data/zeus.db - mysql: - dsn: ${MYSQL_USERNAME}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/${MYSQL_DB}?charset=utf8&parseTime=True&loc=Local - pool: - max: 20 - min: 5 +mode: debug +project: + merge: true redis: host: 127.0.0.1:6379 pool: max: 20 min: 3 -project: - merge: true \ No newline at end of file +security: + install_lock: false diff --git a/config/in-local.yaml b/config/in-local.yaml index 401a21a..e659ae6 100644 --- a/config/in-local.yaml +++ b/config/in-local.yaml @@ -23,12 +23,12 @@ cors: enable: false max_age: 7200 database: - driver: mysql + driver: sqlite mysql: charset: utf8 host: 127.0.0.1:3306 name: zeus - password: 123456 + password: root pool: max: 20 min: 5 @@ -37,22 +37,22 @@ database: sqlite: dsn: data/zeus.db dingtalk: + agentid: 310135985 + appkey: dingvgvn9hdcp8qtarno + appsecret: Sn887TtSQgGQNRcSaP-cNQXKYOkuT062vPgHoVvbTm5-HA2qnyew6xbdgZwhxD8N + cachepath: data/ + corpid: dingd60a58f4e3be699235c2f4657eb6378f snsappid: dingoa1uudyxl2dcjvqpij snssecret: o8YvDT5l2zb9dikuCbz0HXOiOaVwdyVResrDVyFaqojv0EwZp8ygAemFyoSBh_lz - CorpId: dingd60a58f4e3be699235c2f4657eb6378f - SSOsecret: XU3oARxOHw731w4LYEJodPEPtppX5oMa7XPp5dv2VjTLak9I--glTDBLLbcl2VpQ - AgentId: 310135985 - AppKey: dingvgvn9hdcp8qtarno - AppSecret: Sn887TtSQgGQNRcSaP-cNQXKYOkuT062vPgHoVvbTm5-HA2qnyew6xbdgZwhxD8N - CachePath: data/ + ssosecret: XU3oARxOHw731w4LYEJodPEPtppX5oMa7XPp5dv2VjTLak9I--glTDBLLbcl2VpQ domain: bullteam.local email: smtp: - address: "ss@163.com" - password: "xxxxxx" + address: ss@163.com + password: xxxxxx port: 25 - server: "smtp.163.com" - user: "ss@163.com" + server: smtp.163.com + user: vcoso@163.com jwt: expiresat: 3600*24*1 key: diff --git a/go.mod b/go.mod index 01398a0..45a5630 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module zeus -go 1.12 +go 1.13 require ( cloud.google.com/go v0.39.0 // indirect @@ -10,7 +10,7 @@ require ( github.com/astaxie/beego v1.11.1 github.com/beego/i18n v0.0.0-20161101132742-e9308947f407 github.com/billcobbler/casbin-redis-watcher v0.0.0-20180829182704-69cab1cdcf44 - github.com/bullteam/go-dingtalk v0.0.0-20191101170053-a81fcfa9edf9 + github.com/bullteam/go-dingtalk v0.0.0-20191103124359-201d069950ae github.com/casbin/casbin v1.8.3 github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3 github.com/garyburd/redigo v1.6.0 // indirect diff --git a/go.sum b/go.sum index 06ad4ed..c2d2cab 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU= cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= cloud.google.com/go v0.39.0 h1:UgQP9na6OTfp4dsAiz/eFpFA1C6tPdH5wiRdi19tuMw= cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= @@ -20,7 +19,6 @@ github.com/Unknwon/goconfig v0.0.0-20190425194916-3dba17dd7b9e h1:ZaFHdRwv6wJQMY github.com/Unknwon/goconfig v0.0.0-20190425194916-3dba17dd7b9e/go.mod h1:wngxua9XCNjvHjDiTiV26DaKDT+0c63QR6H5hjVUUxw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/appleboy/gin-jwt/v2 v2.6.2 h1:aW8jd9Zt5lU5W18GvLMO3/T9O8DETfW3O7GzGxcL6So= @@ -39,8 +37,8 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/billcobbler/casbin-redis-watcher v0.0.0-20180829182704-69cab1cdcf44 h1:6IUAqiLy9jbnkun5V2TE+RzFu4fy+qqn/bS80I+L0B4= github.com/billcobbler/casbin-redis-watcher v0.0.0-20180829182704-69cab1cdcf44/go.mod h1:7gAaWqZ3MW7v5114HJaUNsNxaVCV6LHknrrwQtnjGX4= github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6Mmwb0LSuEubjR8N7PtNe1KxZLtOUHtbeikc5h60= -github.com/bullteam/go-dingtalk v0.0.0-20191101170053-a81fcfa9edf9 h1:soDqEFszhtgYaNRYnKqKCjNOi0jsUDh9/f/QEXHoN0Y= -github.com/bullteam/go-dingtalk v0.0.0-20191101170053-a81fcfa9edf9/go.mod h1:urOpEWIndvtxR1BbNFJRtb6BOC3a9au75usE9HEeW2A= +github.com/bullteam/go-dingtalk v0.0.0-20191103124359-201d069950ae h1:5pqVMrLvcEs108IsG0h7sNnXrOSLmdn56kVu8vXlJnc= +github.com/bullteam/go-dingtalk v0.0.0-20191103124359-201d069950ae/go.mod h1:u/nebD22uHvPnL0M92AsQ1ls43RDsgNcrhziUQn1BWc= github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE= github.com/casbin/casbin v1.8.3 h1:tIrXu7UGj0ECpV4tQhQy9sE2gJZyKNG0tQDEKQiuTYQ= github.com/casbin/casbin v1.8.3/go.mod h1:z8uPsfBJGUsnkagrt3G8QvjgTKFMBJ32UP8HpZllfog= @@ -68,7 +66,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= @@ -76,7 +73,6 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/garyburd/redigo v1.6.0 h1:0VruCpn7yAIIu7pWVClQC8wxCJEcG3nyzpMSHKi1PQc= github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/cors v1.3.0 h1:PolezCc89peu+NgkIWt9OB01Kbzt6IP0J/JvkG6xxlg= github.com/gin-contrib/cors v1.3.0/go.mod h1:artPvLlhkF7oG06nK8v3U8TNz6IeX+w1uzCSEId5/Vc= @@ -121,7 +117,6 @@ github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8l github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -178,11 +173,9 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= @@ -206,7 +199,6 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -216,7 +208,6 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -232,7 +223,6 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= github.com/siddontang/ledisdb v0.0.0-20181029004158-becf5f38d373/go.mod h1:mF1DpOSOUiJRMR+FDqaqu3EBqrybQtrDDszLUZ6oxPg= github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA= -github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE= github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= @@ -272,14 +262,12 @@ github.com/tidwall/pretty v0.0.0-20190325153808-1166b9ac2b65/go.mod h1:XNkn88O1C github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/ugorji/go v1.1.2/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v0.0.0-20181209151446-772ced7fd4c2/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43 h1:BasDe+IErOQKrMVXab7UayvSlIpiyGwRvuX3EKYY7UA= github.com/ugorji/go/codec v0.0.0-20190204201341-e444a5086c43/go.mod h1:iT03XoTwV7xq/+UGwKO3UbC1nNNlopQiY61beSdrtOA= github.com/ugorji/go/codec v0.0.0-20190320090025-2dc34c0b8780 h1:vG/gY/PxA3v3l04qxe3tDjXyu3bozii8ulSlIPOYKhI= github.com/ugorji/go/codec v0.0.0-20190320090025-2dc34c0b8780/go.mod h1:iT03XoTwV7xq/+UGwKO3UbC1nNNlopQiY61beSdrtOA= -github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -294,7 +282,6 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181127143415-eb0de9b17e85/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo= golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -313,7 +300,6 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190322120337-addf6b3196f6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c h1:uOCk1iQW6Vc18bnC13MfzScl+wdKBmM9Y9kU7Z83/lw= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -331,15 +317,12 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190322080309-f49334f85ddc/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/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= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -358,7 +341,6 @@ golang.org/x/tools v0.0.0-20190525145741-7be61e1b0e51/go.mod h1:RgjU9mgBXZiqYHBn google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.0 h1:Tfd7cKwKbFRsI8RMAD3oqqw7JPFRrvFlOsfbgVkjOOw= google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -368,7 +350,6 @@ google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= diff --git a/pkg/api/controllers/setting.go b/pkg/api/controllers/setting.go index 3642498..c55ab2a 100644 --- a/pkg/api/controllers/setting.go +++ b/pkg/api/controllers/setting.go @@ -78,3 +78,16 @@ func (s *SettingController) EmailUpdate(c *gin.Context) { "result": EmailSettingDTO, }) } + +// @Tags Department +// @Summary 同步钉钉部门信息 +// @Security ApiKeyAuth +// @Produce json +// @Success 200 {string} json "{"code":200,"data":""}" +// @Router /v1/depts/sync/dingtalk [get] +func (d *SettingController) SyncDingtalk(c *gin.Context) { + data := SettingService.SyncDingtalk() + resp(c, map[string]interface{}{ + "result": data, + }) +} diff --git a/pkg/api/controllers/user.go b/pkg/api/controllers/user.go index ac7f03c..8cd8a26 100644 --- a/pkg/api/controllers/user.go +++ b/pkg/api/controllers/user.go @@ -86,7 +86,11 @@ func (u *UserController) Roles(c *gin.Context) { func (u *UserController) Create(c *gin.Context) { var userDto dto.UserCreateDto if u.BindAndValidate(c, &userDto) { - user := userService.Create(userDto) + user, err := userService.Create(userDto) + if err != nil { + fail(c, ErrInputData) + return + } // TODO insert ldap user // insert operation log b, _ := json.Marshal(userDto) diff --git a/pkg/api/domain/dept/sync/dingtalk.go b/pkg/api/domain/dept/sync/dingtalk.go new file mode 100644 index 0000000..5c8ac8d --- /dev/null +++ b/pkg/api/domain/dept/sync/dingtalk.go @@ -0,0 +1,24 @@ +package sync + +import ( + dingtalk "github.com/bullteam/go-dingtalk/src" + "github.com/spf13/viper" +) + +func GetDingTalkUserInfo() (deptInfos interface{}, err error) { + c := GetCompanyDingTalkClient() + c.RefreshCompanyAccessToken() + list, err := c.DepartmentList(1, "zh_CN") + if err != nil { + return nil, err + } + return list.Department, nil +} + +func GetCompanyDingTalkClient() *dingtalk.DingTalkClient { + return dingtalk.NewDingTalkCompanyClient(&dingtalk.DTConfig{ + AppKey: viper.GetString("dingtalk.appkey"), + AppSecret: viper.GetString("dingtalk.appsecret"), + CachePath: viper.GetString("dingtalk.CachePath"), + }) +} diff --git a/pkg/api/dto/data_perm.go b/pkg/api/dto/data_perm.go index 8ce53da..8bb5beb 100644 --- a/pkg/api/dto/data_perm.go +++ b/pkg/api/dto/data_perm.go @@ -9,7 +9,7 @@ type DataPermAddDto struct { DomainId int `form:"domain_id" json:"domain_id" binding:"required"` // 项目域id ParentId int `form:"parent_id" json:"parent_id"` // 父级id Name string `form:"name" json:"name" binding:"required"` // 名称 - Perms string `form:"perms" json:"perms"` // 数据权限key + Perms string `form:"perms" json:"perms" binding:"permsValidate"` // 数据权限key PermsRule string `form:"perms_rule" json:"perms_rule"` // 数据权限规则 PermsType int `form:"perms_type" json:"perms_type" binding:"required"` // 类型 1=分类 2=数据权限 OrderNum int `form:"order_num" json:"order_num" binding:"required"` // 排序字段 @@ -21,9 +21,9 @@ type DataPermEditDto struct { DomainId int `form:"domain_id" json:"domain_id" binding:"required"` // 项目域id ParentId int `form:"parent_id" json:"parent_id"` // 菜单ID Name string `form:"name" json:"name" binding:"required"` // 名称 - Perms string `form:"perms" json:"perms" binding:"required"` // 数据权限key + Perms string `form:"perms" json:"perms" binding:"required" binding:"permsValidate"` // 数据权限key PermsRule string `form:"perms_rule" json:"perms_rule" binding:"required"` // 数据权限规则 PermsType int `form:"perms_type" json:"perms_type" binding:"required"` // 类型 1=分类 2=数据权限 OrderNum int `form:"order_num" json:"order_num" binding:"required"` // 排序字段 Remarks string `form:"remarks" json:"remarks"` // 说明 -} +} \ No newline at end of file diff --git a/pkg/api/dto/init.go b/pkg/api/dto/init.go index 97f6151..e0dcc46 100644 --- a/pkg/api/dto/init.go +++ b/pkg/api/dto/init.go @@ -14,6 +14,7 @@ func init() { if v, ok := binding.Validator.Engine().(*validator.Validate); ok { _ = v.RegisterValidation("customValidate", customValidate) _ = v.RegisterValidation("pwdValidate", pwdValidate) + _ = v.RegisterValidation("permsValidate",permsValidate) } } @@ -41,4 +42,5 @@ var ValidateErrorMessage = map[string]string{ "customValidate": "%s can not be %s", "required": "%s is required,got empty %#v", "pwdValidate": "%s is not a valid password", + "permsValidate": "%s contains comma", } diff --git a/pkg/api/dto/menu.go b/pkg/api/dto/menu.go index 51d4b85..eaa1b9d 100644 --- a/pkg/api/dto/menu.go +++ b/pkg/api/dto/menu.go @@ -1,5 +1,11 @@ package dto +import ( + "gopkg.in/go-playground/validator.v8" + "reflect" + "strings" +) + // UserListSearchMapping - define search query keys in user list page var MenuListSearchMapping = map[string]string{ "d": "domain_id", @@ -11,7 +17,7 @@ type MenuCreateDto struct { ParentId int `form:"parent_id,default=0" json:"parent_id" binding:"gte=0"` DomainId int `form:"domain_id" json:"domain_id" binding:"required,gte=1"` Url string `form:"url" json:"url"` - Perms string `form:"perms" json:"perms"` + Perms string `form:"perms" json:"perms" binding:"permsValidate"` // alias which can be checked with permission(Like Perms above) also Alias string `form:"alias" json:"alias"` MenuType int `form:"menu_type,default=1" json:"menu_type"` @@ -26,10 +32,19 @@ type MenuEditDto struct { ParentId int `form:"parent_id,default=0" json:"parent_id" binding:"gte=0"` DomainId int `form:"domain_id" json:"domain_id" binding:"required,gte=1"` Url string `form:"url" json:"url"` - Perms string `form:"perms" json:"perms"` + Perms string `form:"perms" json:"perms" binding:"permsValidate"` // alias which can be checked with permission(Like Perms above) also Alias string `form:"alias" json:"alias"` MenuType int `form:"menu_type,default=0" json:"menu_type"` Icon string `form:"icon" json:"icon"` OrderNum int `form:"order_num,default=1" json:"order_num"` } + +func permsValidate(v *validator.Validate, topStruct reflect.Value, currentStructOrField reflect.Value, field reflect.Value, fieldType reflect.Type, fieldKind reflect.Kind, param string) bool { + if val, ok := field.Interface().(string); ok { + if strings.Contains(val,",") { + return false + } + } + return true +} diff --git a/pkg/api/model/department.go b/pkg/api/model/department.go index a8cd3ca..04a589d 100644 --- a/pkg/api/model/department.go +++ b/pkg/api/model/department.go @@ -1,10 +1,11 @@ package model type Department struct { - Id int `json:"id"` - Name string `json:"name"` - OrderNum int `json:"order_num"` - ParentId int `json:"parent_id"` + Id int `json:"id"` + Name string `json:"name"` + OrderNum int `json:"order_num"` + ParentId int `json:"parent_id"` + ExtendField string `json:"extend_field"` } func (Department) TableName() string { diff --git a/pkg/api/router/router.go b/pkg/api/router/router.go index 9144321..6504377 100644 --- a/pkg/api/router/router.go +++ b/pkg/api/router/router.go @@ -142,6 +142,7 @@ func SetUp(e *gin.Engine, cors bool) { v1.POST("/setting/ldap", settingController.LdapUpdate) v1.GET("/setting/email", settingController.EmailList) v1.POST("/setting/email", settingController.EmailUpdate) + v1.GET("/setting/sync/dingtalk", settingController.SyncDingtalk) if viper.GetBool("project.merge") { e.LoadHTMLGlob("./pkg/webui/dist/*.html") // 添加入口index.html diff --git a/pkg/api/service/menu.go b/pkg/api/service/menu.go index 8cd3a17..786e799 100644 --- a/pkg/api/service/menu.go +++ b/pkg/api/service/menu.go @@ -68,7 +68,7 @@ func (ms MenuService) Update(menuDto dto.MenuEditDto) int64 { "icon": menuDto.Icon, }) // 1.Remove all alias - menuPermAliasDao.Delete(model.MenuPermAlias{Perms: menuDto.Perms, DomainId: menuDto.DomainId}) + menuPermAliasDao.Delete(model.MenuPermAlias{Perms: menuModel.Perms, DomainId: menuModel.DomainId}) // 2.Save new alias again for _, alias := range strings.Split(menuDto.Alias, ",") { menuPermAliasDao.Create(&model.MenuPermAlias{ diff --git a/pkg/api/service/myaccount.go b/pkg/api/service/myaccount.go index 59abb66..ace5d38 100644 --- a/pkg/api/service/myaccount.go +++ b/pkg/api/service/myaccount.go @@ -96,5 +96,3 @@ func (s MyAccountService) BindDingtalk(code string, uid int, from int) (openid s s.oauthdao.Create(&userOAuth) return Info.Openid, nil } - - diff --git a/pkg/api/service/role.go b/pkg/api/service/role.go index b05cb40..766cec8 100644 --- a/pkg/api/service/role.go +++ b/pkg/api/service/role.go @@ -19,23 +19,25 @@ type RoleService struct { } // InfoOfId - get role info by id -func (rs RoleService) InfoOfId(dto dto.GeneralGetDto) model.Role { +func (RoleService) InfoOfId(dto dto.GeneralGetDto) model.Role { return roleDao.Get(dto.Id, true) } // List - users list with pagination -func (rs RoleService) List(dto dto.GeneralListDto) ([]model.Role, int64) { +func (RoleService) List(dto dto.GeneralListDto) ([]model.Role, int64) { return roleDao.List(dto) } // AssignPermission - assign permissions -func (rs RoleService) AssignPermission(roleId int, menuIds string) { +func (RoleService) AssignPermission(roleId int, menuIds string) { roleData := roleDao.Get(roleId, true) menus := menuDao.GetMenusPermByIds(menuIds) if len(menus) > 0 { var policies [][]string for _, m := range menus { if m.Url == "" && m.Perms != "" { + //Do not allow comma which would cause panic error with casbin rules + m.Perms = strings.Replace(m.Perms,",","|",-1) policies = append(policies, []string{roleData.RoleName, m.Perms, "*", roleData.Domain.Code}) } } diff --git a/pkg/api/service/setting.go b/pkg/api/service/setting.go index a6cea92..d06372b 100644 --- a/pkg/api/service/setting.go +++ b/pkg/api/service/setting.go @@ -1,14 +1,27 @@ package service import ( + "encoding/json" + dingtalk "github.com/bullteam/go-dingtalk/src" "github.com/spf13/viper" + "zeus/pkg/api/domain/dept/sync" "zeus/pkg/api/dto" + "zeus/pkg/api/log" + + //"zeus/pkg/api/log" "zeus/pkg/api/model" ) type SettingService struct { } +type Department struct { + Id int + Name string + ParentId int + Children []*Department +} + func (s SettingService) GetLdap() model.LdapSetting { ldapSetting := model.LdapSetting{} ldapSetting.LdapUrl = viper.GetString("ldap.addr") @@ -34,7 +47,6 @@ func (s SettingService) LdapUpdate(SettingDTO dto.SettingDTO) bool { return true } return false - return false } func (s SettingService) GetEmail() model.EmailSetting { @@ -61,3 +73,57 @@ func (s SettingService) EmailUpdate(SettingDTO dto.EmailSettingDTO) bool { } return false } + +// sync dept +func (s SettingService) SyncDingtalk() bool { + deptinfos, _ := sync.GetDingTalkUserInfo() + depts := deptinfos.([]dingtalk.Department) + res, _ := NodeDataMerge(depts, 0) + SyncDept(res, 0, 1) + return true +} + +//Recursive node for dept +func NodeDataMerge(nodeList []dingtalk.Department, pid int) (dataList []*Department, err error) { + for _, v := range nodeList { + if v.ParentId == pid { + children, _ := NodeDataMerge(nodeList, v.Id) + parent := Department{Id: v.Id, ParentId: v.ParentId, Name: v.Name, Children: children} + dataList = append(dataList, &parent) + } + } + return dataList, nil +} + +//Recursive insert into db +func SyncDept(dataList []*Department, pid int, deptId int) { + for _, vv := range dataList { + var exts Department + exts.Id = vv.Id + exts.Name = vv.Name + exts.ParentId = vv.ParentId + extendField, _ := json.Marshal(exts) + insertDataDept(deptId, vv.Name, pid, string(extendField)) + deptId++ + if len(vv.Children) > 0 { + pid = deptId - 1 + SyncDept(vv.Children, pid, deptId) + } + } +} + +func insertDataDept(id int, name string, parentId int, extendField string) bool { + deptModel := model.Department{ + Id: id, + Name: name, + ParentId: parentId, + OrderNum: 0, + ExtendField: extendField, + } + c := deptDao.Create(&deptModel) + if c.Error != nil { + log.Error(c.Error.Error()) + return false + } + return true +} diff --git a/pkg/api/service/user.go b/pkg/api/service/user.go index b83dd88..87cb6a7 100644 --- a/pkg/api/service/user.go +++ b/pkg/api/service/user.go @@ -1,6 +1,7 @@ package service import ( + "errors" "strconv" "strings" "zeus/pkg/api/dao" @@ -34,7 +35,14 @@ func (us UserService) List(dto dto.GeneralListDto) ([]model.User, int64) { } // Create - create a new account -func (us UserService) Create(userDto dto.UserCreateDto) model.User { +func (us UserService) Create(userDto dto.UserCreateDto) (*model.User, error) { + + //if username is exits,it can't create this user + u := userDao.GetByUserName(userDto.Username) + if u.Username == userDto.Username { + return nil, errors.New("username is exits") + } + salt, _ := account.MakeSalt() pwd, _ := account.HashPassword(userDto.Password, salt) userModel := model.User{ @@ -52,12 +60,14 @@ func (us UserService) Create(userDto dto.UserCreateDto) model.User { c := userDao.Create(&userModel) if c.Error != nil { log.Error(c.Error.Error()) - } else { - if userDto.Roles != "" { - us.AssignRole(strconv.Itoa(userModel.Id), strings.Split(userDto.Roles, ",")) - } + return nil, errors.New("create user failed") } - return userModel + + if userDto.Roles != "" { + us.AssignRole(strconv.Itoa(userModel.Id), strings.Split(userDto.Roles, ",")) + } + + return &userModel, nil } // Update - update user's information diff --git a/pkg/webui/src/main.js b/pkg/webui/src/main.js index 528bf58..a58ecd0 100644 --- a/pkg/webui/src/main.js +++ b/pkg/webui/src/main.js @@ -22,6 +22,7 @@ import './icons' // icon import config from '@/config' import installPlugin from '@/plugin' import importDirective from '@/directive' +import { getToken } from '@/utils/auth' import * as filters from './filters' // global filters @@ -31,7 +32,22 @@ Vue.use(Element, { }) Vue.use(ams) -ams.config({ resource: { api: { successCode: 200 }}}) +ams.config({ + resource: { + requestInterceptor(options) { + console.log('requestInterceptor', options) + options.headers = { + ...options.headers, + Authorization: 'Bearer ' + getToken() + } + return options + }, + api: { + successCode: 200, + withCredentials: false + } + } +}) // register global utility filters. Object.keys(filters).forEach(key => { Vue.filter(key, filters[key]) diff --git a/pkg/webui/src/views/logs/operation.vue b/pkg/webui/src/views/logs/operation.vue index a8bdbd6..14ae3c6 100644 --- a/pkg/webui/src/views/logs/operation.vue +++ b/pkg/webui/src/views/logs/operation.vue @@ -156,9 +156,9 @@ export default { this.total = response.data.total // Just to simulate the time of the request - setTimeout(() => { - this.listLoading = false - }, 1.5 * 1000) + // setTimeout(() => { + this.listLoading = false + // }, 1.5 * 1000) }) }, toSearch() { diff --git a/pkg/webui/src/views/my/index.vue b/pkg/webui/src/views/my/index.vue index 55b69bf..97196ac 100644 --- a/pkg/webui/src/views/my/index.vue +++ b/pkg/webui/src/views/my/index.vue @@ -1,7 +1,7 @@