diff --git a/README.md b/README.md index 9749a8a..3d61e55 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # spring-cloud-base 微服务基础框架,基于 SpringCloud 及 SpringBoot 开发。 使用 Oauth2 统一授权、认证, Oauth示例客户端使用 Vue 开发,具有用户管理、 资源管理、 角色管理等模块,后端包括授权中心、 基础数据中心(资源服务器)等应用,可作为微服务快速开发脚手架。 可通过 docker 快速构建部署。 -Demo website:http://112.74.60.248:8080/ +Demo website:http://www.mxclass.cn username: test password: 123456 phone: 13100000000 verifyCode: 1000 diff --git a/api-gateway/src/main/java/com/peng/gateway/ApiGatewayApplication.java b/api-gateway/src/main/java/com/peng/gateway/ApiGatewayApplication.java index 78ff876..6d12fb3 100644 --- a/api-gateway/src/main/java/com/peng/gateway/ApiGatewayApplication.java +++ b/api-gateway/src/main/java/com/peng/gateway/ApiGatewayApplication.java @@ -15,4 +15,5 @@ public class ApiGatewayApplication { public static void main(String[] args){ SpringApplication.run(ApiGatewayApplication.class, args); } + } diff --git a/api-gateway/src/main/java/com/peng/gateway/config/CorsConfig.java b/api-gateway/src/main/java/com/peng/gateway/config/CorsConfig.java index 39a7ffb..bdfb20a 100644 --- a/api-gateway/src/main/java/com/peng/gateway/config/CorsConfig.java +++ b/api-gateway/src/main/java/com/peng/gateway/config/CorsConfig.java @@ -11,12 +11,13 @@ /** * Created by fp295 on 2018/5/6. + * 跨域开发环境使用 vue-cli 代理,正式用nginx */ @Order(2) @Configuration public class CorsConfig { - @Bean + /*@Bean public FilterRegistrationBean corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); @@ -24,9 +25,9 @@ public FilterRegistrationBean corsFilter() { config.addAllowedOrigin("*"); config.addAllowedHeader("*"); config.addAllowedMethod("*"); - source.registerCorsConfiguration("/**", config); + source.registerCorsConfiguration("*", config); FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); bean.setOrder(Ordered.HIGHEST_PRECEDENCE); return bean; - } + }*/ } diff --git a/api-gateway/src/main/resources/application.yml b/api-gateway/src/main/resources/application.yml index af4685f..9f8b759 100644 --- a/api-gateway/src/main/resources/application.yml +++ b/api-gateway/src/main/resources/application.yml @@ -12,7 +12,7 @@ server: zuul: routes: main-data: - path: /main-data/api/** + path: /api/main-data/** serviceId: main-data proxy: auth: diff --git a/auth-center/auth-center-api/src/main/java/com/peng/auth/api/pojo/auth/BaseUserDetail.java b/auth-center/auth-center-api/src/main/java/com/peng/auth/api/pojo/auth/BaseUserDetail.java index 43c3d54..bb00d6b 100644 --- a/auth-center/auth-center-api/src/main/java/com/peng/auth/api/pojo/auth/BaseUserDetail.java +++ b/auth-center/auth-center-api/src/main/java/com/peng/auth/api/pojo/auth/BaseUserDetail.java @@ -11,6 +11,7 @@ /** * Created by fp295 on 2018/4/29. * 包装org.springframework.security.core.userdetails.User类 + * 新增 baseUser 用于生成 jwt 的用户信息 */ public class BaseUserDetail implements UserDetails, CredentialsContainer { diff --git a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/AuthorizationServerConfig.java b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/AuthorizationServerConfig.java index 54f28e9..62148de 100644 --- a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/AuthorizationServerConfig.java +++ b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/AuthorizationServerConfig.java @@ -108,9 +108,9 @@ public JwtAccessTokenConverter jwtAccessTokenConverter() { /** - * 跨域 + * 跨域, 开发环境使用 vue-cli 代理,正式用nginx */ - @Bean + /*@Bean public FilterRegistrationBean corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); @@ -118,10 +118,10 @@ public FilterRegistrationBean corsFilter() { config.addAllowedOrigin("*"); config.addAllowedHeader("*"); config.addAllowedMethod("*"); - source.registerCorsConfiguration("/**", config); + source.registerCorsConfiguration("*//**", config); FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); bean.setOrder(Ordered.HIGHEST_PRECEDENCE); return bean; - } + }*/ } diff --git a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/filter/MyLoginAuthenticationFilter.java b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/filter/MyLoginAuthenticationFilter.java index 2a03ab8..b954bac 100644 --- a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/filter/MyLoginAuthenticationFilter.java +++ b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/filter/MyLoginAuthenticationFilter.java @@ -16,6 +16,12 @@ /** * Created by fp295 on 2018/6/16. * 自定义登陆filter,新增登陆方式:验证码、二维码扫码、账号密码; + * 验证码登陆: + * post: /login?type=phone&phone=13000000000&verifyCode=1000 + * 二维码登陆: + * post: /login?type=qr&qrCode=token + * 账号密码登陆: + * post: /login?username=username&password=password * 此filter 为生成自定义的 MyAuthenticationToken */ public class MyLoginAuthenticationFilter extends AbstractAuthenticationProcessingFilter { diff --git a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/provider/MyAuthenticationProvider.java b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/provider/MyAuthenticationProvider.java index cdf8b4e..ad7d7f6 100644 --- a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/provider/MyAuthenticationProvider.java +++ b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/auth/provider/MyAuthenticationProvider.java @@ -77,7 +77,7 @@ protected final UserDetails retrieveUser(String username, MyAuthenticationToken UserDetails loadedUser; try { // 调用loadUserByUsername时加入type前缀 - loadedUser = this.getUserDetailsService().loadUserByUsername(authentication.getType() + ":" + username); + loadedUser = this.getUserDetailsService().loadUserByUsername(authentication.getType() + "&:@" + username); } catch (UsernameNotFoundException var6) { if(authentication.getCredentials() != null) { String presentedPassword = authentication.getCredentials().toString(); diff --git a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/MvcController.java b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/MvcController.java index c3df311..02dc336 100644 --- a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/MvcController.java +++ b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/MvcController.java @@ -66,7 +66,7 @@ public ModelAndView authorizePage(Map model) { } /** - * 主页 + * 主页,未从客户端跳转直接登陆会显示 * @param model * @return */ diff --git a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/WebMvcConfig.java b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/WebMvcConfig.java index e70ec82..fbceab6 100644 --- a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/WebMvcConfig.java +++ b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/config/web/WebMvcConfig.java @@ -11,12 +11,20 @@ @Configuration public class WebMvcConfig extends WebMvcConfigurerAdapter { + /** + * ftl视图 + * @param registry + */ @Override public void addViewControllers(ViewControllerRegistry registry){ registry.addViewController("/login").setViewName("login"); //registry.addViewController("/").setViewName("authorize"); } + /** + * 静态资源 + * @param registry + */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); diff --git a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/service/BaseUserDetailService.java b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/service/BaseUserDetailService.java index 384eeac..5ca274b 100644 --- a/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/service/BaseUserDetailService.java +++ b/auth-center/auth-center-provider/src/main/java/com/peng/auth/provider/service/BaseUserDetailService.java @@ -48,7 +48,15 @@ public class BaseUserDetailService implements UserDetailsService { public UserDetails loadUserByUsername(String var1) throws UsernameNotFoundException { BaseUser baseUser; - String[] parameter = var1.split(":"); + String[] parameter; + int index = var1.indexOf("&:@"); + if (index != -1) { + parameter = var1.split("&:@"); + }else { + // 如果是 refresh_token 不分割 + parameter = new String[]{MyLoginAuthenticationFilter.SPRING_SECURITY_RESTFUL_TYPE_DEFAULT, var1}; + } + // 手机验证码调用FeignClient根据电话号码查询用户 if(MyLoginAuthenticationFilter.SPRING_SECURITY_RESTFUL_TYPE_PHONE.equals(parameter[0])){ ResponseData baseUserResponseData = baseUserService.getUserByPhone(parameter[1]); @@ -70,6 +78,7 @@ public UserDetails loadUserByUsername(String var1) throws UsernameNotFoundExcept baseUser = baseUserResponseData.getData(); } + // 调用FeignClient查询角色 ResponseData> baseRoleListResponseData = baseRoleService.getRoleByUserId(baseUser.getId()); List roles; diff --git a/web-app/config/index.js b/web-app/config/index.js index 926ab36..11237a0 100644 --- a/web-app/config/index.js +++ b/web-app/config/index.js @@ -10,7 +10,16 @@ module.exports = { // Paths assetsSubDirectory: 'static', assetsPublicPath: '/', - proxyTable: {}, + proxyTable: { + '/api':{ + target: 'http://127.0.0.1:18000', + changeOrigin: true // 必须,为true的话,请求的header将会设置为匹配目标服务器的规则(Access-Control-Allow-Origin) + }, + '/auth':{ + target: 'http://127.0.0.1:18001', + changeOrigin: true // 必须,为true的话,请求的header将会设置为匹配目标服务器的规则(Access-Control-Allow-Origin) + } + }, // Various Dev Server settings host: 'localhost', // can be overwritten by process.env.HOST diff --git a/web-app/package-lock.json b/web-app/package-lock.json index b2cda4b..ad8f029 100644 --- a/web-app/package-lock.json +++ b/web-app/package-lock.json @@ -178,7 +178,6 @@ "version": "1.3.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", - "dev": true, "requires": { "mime-types": "2.1.18", "negotiator": "0.6.1" @@ -348,8 +347,7 @@ "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", - "dev": true + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, "array-includes": { "version": "3.0.3", @@ -1525,7 +1523,6 @@ "version": "1.18.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", - "dev": true, "requires": { "bytes": "3.0.0", "content-type": "1.0.4", @@ -1542,8 +1539,7 @@ "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" } } }, @@ -1741,8 +1737,7 @@ "bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", - "dev": true + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, "cacache": { "version": "10.0.4", @@ -2279,14 +2274,12 @@ "content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", - "dev": true + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "dev": true + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, "convert-source-map": { "version": "1.5.1", @@ -2296,14 +2289,12 @@ "cookie": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", - "dev": true + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" }, "cookie-signature": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", - "dev": true + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, "copy-concurrently": { "version": "1.0.5", @@ -2961,8 +2952,7 @@ "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "dev": true + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" }, "des.js": { "version": "1.0.0", @@ -2977,8 +2967,7 @@ "destroy": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", - "dev": true + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "detect-indent": { "version": "4.0.0", @@ -3150,8 +3139,7 @@ "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", - "dev": true + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "ejs": { "version": "2.5.9", @@ -3203,8 +3191,7 @@ "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "dev": true + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" }, "encoding": { "version": "0.1.12", @@ -3364,8 +3351,7 @@ "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "dev": true + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, "escape-string-regexp": { "version": "1.0.5", @@ -3386,8 +3372,8 @@ }, "eslint": { "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "resolved": "http://registry.npm.taobao.org/eslint/download/eslint-4.19.1.tgz", + "integrity": "sha1-MtHWU+HZBAiFS/spbwdux+GGowA=", "dev": true, "requires": { "ajv": "5.5.2", @@ -3405,12 +3391,12 @@ "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "11.5.0", + "globals": "11.7.0", "ignore": "3.3.8", "imurmurhash": "0.1.4", "inquirer": "3.3.0", "is-resolvable": "1.1.0", - "js-yaml": "3.11.0", + "js-yaml": "3.12.0", "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", "lodash": "4.17.10", @@ -3432,14 +3418,14 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "resolved": "http://registry.npm.taobao.org/ansi-regex/download/ansi-regex-3.0.0.tgz", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "debug": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "resolved": "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", "dev": true, "requires": { "ms": "2.0.0" @@ -3447,20 +3433,20 @@ }, "esprima": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "resolved": "http://registry.npm.taobao.org/esprima/download/esprima-4.0.0.tgz", + "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", "dev": true }, "globals": { - "version": "11.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", - "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "version": "11.7.0", + "resolved": "http://registry.npm.taobao.org/globals/download/globals-11.7.0.tgz", + "integrity": "sha1-pYP6pDBVsayncZFL9oJY4vwSVnM=", "dev": true }, "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "version": "3.12.0", + "resolved": "http://registry.npm.taobao.org/js-yaml/download/js-yaml-3.12.0.tgz", + "integrity": "sha1-6u1lbsg0TxD1J8a/obbiJE3hZ9E=", "dev": true, "requires": { "argparse": "1.0.10", @@ -3469,7 +3455,7 @@ }, "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "resolved": "http://registry.npm.taobao.org/strip-ansi/download/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { @@ -3729,8 +3715,7 @@ "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "dev": true + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, "event-emitter": { "version": "0.3.5", @@ -3862,9 +3847,8 @@ }, "express": { "version": "4.16.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "resolved": "http://registry.npm.taobao.org/express/download/express-4.16.3.tgz", "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", - "dev": true, "requires": { "accepts": "1.3.5", "array-flatten": "1.1.1", @@ -3900,9 +3884,8 @@ "dependencies": { "safe-buffer": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true + "resolved": "http://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.1.tgz", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" } } }, @@ -4180,7 +4163,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", - "dev": true, "requires": { "debug": "2.6.9", "encodeurl": "1.0.2", @@ -4299,8 +4281,7 @@ "forwarded": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", - "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", - "dev": true + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" }, "fragment-cache": { "version": "0.2.1", @@ -4314,8 +4295,7 @@ "fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "dev": true + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, "friendly-errors-webpack-plugin": { "version": "1.7.0", @@ -5532,7 +5512,6 @@ "version": "1.6.3", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", - "dev": true, "requires": { "depd": "1.1.2", "inherits": "2.0.3", @@ -5854,8 +5833,7 @@ "ipaddr.js": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", - "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=", - "dev": true + "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" }, "is-absolute-url": { "version": "2.1.0", @@ -6298,7 +6276,7 @@ }, "lazy-debug-legacy": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/lazy-debug-legacy/-/lazy-debug-legacy-0.0.1.tgz", + "resolved": "https://registry.npmjs.org/lazy-debug/-/lazy-debug-0.0.3.tgz", "integrity": "sha1-U3cWwHduTPeePtG2IfdljCkRsbE=" }, "lazystream": { @@ -6624,8 +6602,7 @@ "media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", - "dev": true + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" }, "mem": { "version": "1.1.0", @@ -6754,8 +6731,7 @@ "merge-descriptors": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", - "dev": true + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, "merge-stream": { "version": "1.0.1", @@ -6768,8 +6744,7 @@ "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "dev": true + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" }, "micromatch": { "version": "3.1.10", @@ -7225,8 +7200,7 @@ "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", - "dev": true + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, "neo-async": { "version": "2.5.1", @@ -12632,7 +12606,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "dev": true, "requires": { "ee-first": "1.1.1" } @@ -12889,8 +12862,7 @@ "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", - "dev": true + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" }, "pascalcase": { "version": "0.1.1", @@ -12941,8 +12913,7 @@ "path-to-regexp": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", - "dev": true + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, "path-type": { "version": "3.0.0", @@ -15162,7 +15133,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", - "dev": true, "requires": { "forwarded": "0.1.2", "ipaddr.js": "1.6.0" @@ -15302,14 +15272,12 @@ "range-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", - "dev": true + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" }, "raw-body": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", - "dev": true, "requires": { "bytes": "3.0.0", "http-errors": "1.6.2", @@ -15320,14 +15288,12 @@ "depd": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", - "dev": true + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" }, "http-errors": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", - "dev": true, "requires": { "depd": "1.1.1", "inherits": "2.0.3", @@ -15338,14 +15304,12 @@ "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, "setprototypeof": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", - "dev": true + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" } } }, @@ -15874,7 +15838,6 @@ "version": "0.16.2", "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", - "dev": true, "requires": { "debug": "2.6.9", "depd": "1.1.2", @@ -15894,8 +15857,7 @@ "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", - "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", - "dev": true + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" } } }, @@ -15924,7 +15886,6 @@ "version": "1.13.2", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", - "dev": true, "requires": { "encodeurl": "1.0.2", "escape-html": "1.0.3", @@ -15974,8 +15935,7 @@ "setprototypeof": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", - "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", - "dev": true + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" }, "sha.js": { "version": "2.4.11", @@ -16362,8 +16322,7 @@ "statuses": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", - "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==", - "dev": true + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" }, "stream-browserify": { "version": "2.0.1", @@ -16764,7 +16723,6 @@ "version": "1.6.16", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", - "dev": true, "requires": { "media-typer": "0.3.0", "mime-types": "2.1.18" @@ -16945,8 +16903,7 @@ "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "dev": true + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, "unset-value": { "version": "1.0.0", @@ -17116,8 +17073,7 @@ "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", - "dev": true + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { "version": "3.2.1", @@ -17141,8 +17097,7 @@ "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", - "dev": true + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" }, "vendors": { "version": "1.0.2", diff --git a/web-app/package.json b/web-app/package.json index 14d4517..1e7f328 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -13,6 +13,7 @@ "dependencies": { "aws-sdk": "^2.243.1", "axios": "^0.18.0", + "express": "^4.16.3", "module": "^1.2.5", "moment": "^2.22.1", "node-gyp": "^3.6.2", @@ -40,13 +41,12 @@ "copy-webpack-plugin": "^4.0.1", "css-loader": "^0.28.0", "element-ui": "^2.3.7", - "eslint": "^4.15.0", + "eslint": "^4.19.1", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", "eslint-loader": "^1.7.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-node": "^5.2.0", - "eslint-plugin-prmise": "^3.4.0", "eslint-plugin-promise": "^3.7.0", "eslint-plugin-standard": "^3.0.1", "eslint-plugin-vue": "^4.0.0", diff --git a/web-app/src/components/ApiConstant.js b/web-app/src/components/ApiConstant.js index 8fc0f32..8b879bf 100644 --- a/web-app/src/components/ApiConstant.js +++ b/web-app/src/components/ApiConstant.js @@ -1,4 +1,4 @@ -export const DataMainApi = '/main-data/api' +export const DataMainApi = '/api/main-data' export const Status = { success: 1000 } diff --git a/web-app/src/components/Main.vue b/web-app/src/components/Main.vue index b701f5e..821f95b 100644 --- a/web-app/src/components/Main.vue +++ b/web-app/src/components/Main.vue @@ -1,4 +1,4 @@ -