不使用docker部署项目需要启动的一些服务-cnblog

  • mysql
  • redis
    • ./redis-serve
  • nginx:
    • ./nginx
  • 源springboot项目:
    • nohup java -jar helloworld-1.0-SNAPSHOT.jar &> hello.log &

springboot项目部署到服务器的注意点

  • application.yml

    • redis配置
    • 记得改为localhost
    server:
    port: 18081
    spring:
    application:
    name: com.lingxin.LingxinApplication
    datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql:///studentsystem?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
    username: root
    password: root
    redis:
    port: 6379
    host: localhost
    database: 0
    cache:
    redis:
    time-to-live: 180000
    main:
    allow-bean-definition-overriding: true
    mybatis-plus:
    global-config:
    db-config:
    id-type: assign_id
    banner: off
    configuration:
    #将下划线去掉,使用驼峰命名法
    map-underscore-to-camel-case: true
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    lingxin:
    oss:
    accessKey: LTAI5tQvuDd3Etto8Cm7Fcuc
    secret: PW9PYcA9mQnJAbKY7EwI3X6MaL1kY5
    endpoint: oss-cn-shanghai.aliyuncs.com
    bucketName: lingxin-tanhua
    url: https://lingxin-tanhua.oss-cn-shanghai.aliyuncs.com

前端vue项目

// 导入axios
import axios from 'axios'
// 导入element的加载组件
import { Loading } from 'element-ui'
// 封装一个具有请求根地址的request
const request = axios.create({
// json假数据
baseURL: 'http://www.lingxin1123.work:18081/'
})
// request.defaults.withCredentials = true
// 定义一个加载实例
let loadingInstance = null
// 请求拦截器
request.interceptors.request.use((config) => {
// 配置token字段
const token = sessionStorage.getItem('token')
if (token) {
config.headers.Authorization = token
}
console.log(config)
// 加载效果
loadingInstance = Loading.service({ fullscreen: true })
// 在发起请求时加载element-ui的加载效果
return config
})
// 响应拦截器
request.interceptors.response.use(
(response) => {
// 关闭loading加载效果
loadingInstance.close()
return response
},
(error) => {
// 另外的错误
loadingInstance.close()
return error.response
}
)
// 导出request
export default request
posted @   凌歆  阅读(88)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
点击右上角即可分享
微信分享提示