diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 9c387f6..ec95137 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/**","/login", "/register", "/captchaImage","/system/language/change","/websocket/**").permitAll() + .antMatchers("/login", "/register", "/captchaImage","/system/language/change","/websocket/**").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index fc261ff..d5c9911 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -17,6 +17,7 @@ "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", "@element-plus/icons-vue": "2.0.10", + "@vitejs/plugin-basic-ssl": "^1.0.1", "@vueuse/core": "9.5.0", "axios": "0.27.2", "echarts": "^5.4.0", diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js index 3136544..ff5c0ff 100644 --- a/ruoyi-ui/src/utils/request.js +++ b/ruoyi-ui/src/utils/request.js @@ -26,7 +26,7 @@ console.log(import.meta.env.VITE_APP_BASE_API) const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 baseURL: import.meta.env.VITE_APP_BASE_API, - // baseURL: 'http://47.94.93.46/dev-api', + // baseURL: 'https://ticptest.tercelo.com/dev-api', // 超时 timeout: 10000 }) diff --git a/ruoyi-ui/vite.config.js b/ruoyi-ui/vite.config.js index d3a8730..1ef2bde 100644 --- a/ruoyi-ui/vite.config.js +++ b/ruoyi-ui/vite.config.js @@ -1,6 +1,7 @@ import {defineConfig, loadEnv} from 'vite' import path from 'path' import createVitePlugins from './vite/plugins' +import basicSsl from '@vitejs/plugin-basic-ssl' // https://vitejs.dev/config/ export default defineConfig(({mode, command}) => { @@ -11,7 +12,7 @@ export default defineConfig(({mode, command}) => { // 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 base: VITE_APP_ENV === 'production' ? '/' : '/', - plugins: createVitePlugins(env, command === 'build'), + plugins: [createVitePlugins(env, command === 'build'),basicSsl()], resolve: { // https://cn.vitejs.dev/config/#resolve-alias alias: { @@ -27,12 +28,14 @@ export default defineConfig(({mode, command}) => { server: { port: 80, host: true, + https:true, open: true, proxy: { - // https://cn.vitejs.dev/config/#server-proxy '/dev-api': { + target: 'https://ticptest.tercelo.com/dev-api', + // target: 'http://47.94.93.46/dev-api', // target: 'http://10.11.41.249:8080', - target: 'http://localhost:8080', + // target: 'http://localhost:8080', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, '') }