<!-- 公告 start-->
<view class='notice'>
<view class='notice-contain'>
<text class="cuIcon-notificationfill text-red"></text>
<view class="notice-containTitle">公告栏</view>
<swiper class="tab-right" vertical="true" autoplay="true" circular="true" interval="2000" display-multiple-items='1'>
<view class="right-item">
<block wx:for="{{msgList}}">
<swiper-item>
<view class='content-item'>
<view class="swiper-item text-red text-bold">{{item.title}}</view>
</view>
</swiper-item>
</block>
</view>
</swiper>
</view>
</view>
<!-- 公告 end -->
/* 公告栏 */
.notice {
display: flex;
justify-content: center;
align-items: center;
/* margin-top: 10rpx */
}
.notice-contain {
box-shadow: 0px 1px 1px 1px rgba(202, 199, 199, 0.993);
display: flex;
flex-direction: row;
background: #FFFFFF;
width: 700rpx;
height: 82rpx;
border-radius: 10px;
justify-content: center;
align-items: center;
}
.notice-containTitle {
font-weight: bold;
font-size: 32rpx;
position: relative;
/* top: 0; */
left: 14rpx;
}
.notice-containTitle::after {
position: absolute;
top: -4rpx;
left: 110rpx;
content: "";
display: block;
background: #AAAAAA;
width: 2px;
height: 54rpx;
}
.tab-right {
height: 55rpx;
width: 80%;
line-height: 55rpx;
padding-left: 70rpx;
}
.swiper-item {
font-size: 28rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
letter-spacing: 2px;
}
msgList: [{
title: "视频无水印解析免费无限次使用~"
}, {
title: "视频无水印解析免费无广告使用~"
}]
如果您需要将日期格式化为类似 "2023年5月15日13时30分" 的形式,则可以使用以下代码:
import java.text.SimpleDateFormat;
import java.util.Date;
public class Main {
public static void main(String[] args) {
Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年M月d日H时m分");
String dateString = sdf.format(date);
System.out.println(dateString);
}
}
上述代码中的日期格式化字符串 "yyyy年M月d日H时m分" 表示按照年份、无前导零的月份、无前导零的日、24小时制的小时(不带前导零)、无前导零的分钟的顺序进行日期格式化。使用上述代码运行后,输出结果应该如下所示:
2023年5月15日1时0分
请注意,如果运行 code 中代码的时间刚好处于整点的话,输出结果是“1时0分”,因为没有前导零。
nginx.conf:
user root;
worker_processes 1
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root /home/ubuntu/myapp/ruoyi/ruoyi-ui/dist; # 路径改成自己的dist路径
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
location /prod-api/{
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/; #设置监控后端启动的端口
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
启动nginx:
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
重启:
/usr/local/nginx/sbin/nginx -s reload
查看nginx进程是否启动:
ps -ef | grep nginx
杀进程:
kill -9 pid
jar包后台启动:
nohup java -jar xxx.jar >log.out &
在做查询的时候。用了一个apply的语句
queryWrapper.apply(" DATE_FORMAT( FROM_UNIXTIME( time / 1000, '%Y-%m-%d' ), '%Y-%m-%d' ) ='{0}'", DateUtil.format(new Date(), "yyyy-MM-dd"));
用的动态参数{0}进行参数替换
发现写成'{0}'运行会报错。。。
正确应该为:
queryWrapper.apply(" DATE_FORMAT( FROM_UNIXTIME( time / 1000, '%Y-%m-%d' ), '%Y-%m-%d' ) ={0}", DateUtil.format(new Date(), "yyyy-MM-dd"));
我怀疑是因为mybatisplus的sql解析不能识别'?'
会报错。。