Skip to content

Commit cc8b370

Browse files
committed
fixed some bugs
1 parent 77abdd4 commit cc8b370

File tree

12 files changed

+213
-50
lines changed

12 files changed

+213
-50
lines changed

MHC博客.xcodeproj/project.pbxproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,7 @@
16441644
SDKROOT = iphoneos;
16451645
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
16461646
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1647+
SWIFT_VERSION = 6.0;
16471648
};
16481649
name = Debug;
16491650
};
@@ -1704,6 +1705,7 @@
17041705
SDKROOT = iphoneos;
17051706
SWIFT_COMPILATION_MODE = wholemodule;
17061707
SWIFT_OPTIMIZATION_LEVEL = "-O";
1708+
SWIFT_VERSION = 6.0;
17071709
VALIDATE_PRODUCT = YES;
17081710
};
17091711
name = Release;
@@ -1750,7 +1752,7 @@
17501752
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
17511753
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait;
17521754
INSTALL_PATH = /Application;
1753-
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
1755+
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
17541756
LD_QUOTE_LINKER_ARGUMENTS_FOR_COMPILER_DRIVER = YES;
17551757
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
17561758
MARKETING_VERSION = 5;
@@ -1810,7 +1812,7 @@
18101812
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
18111813
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = UIInterfaceOrientationPortrait;
18121814
INSTALL_PATH = /Application;
1813-
IPHONEOS_DEPLOYMENT_TARGET = 17.5;
1815+
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
18141816
LD_QUOTE_LINKER_ARGUMENTS_FOR_COMPILER_DRIVER = YES;
18151817
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
18161818
MARKETING_VERSION = 5;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>MHC博客.xcscheme_^#shared#^_</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
</dict>
14+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>SchemeUserState</key>
6+
<dict>
7+
<key>MHC博客.xcscheme_^#shared#^_</key>
8+
<dict>
9+
<key>orderHint</key>
10+
<integer>0</integer>
11+
</dict>
12+
</dict>
13+
</dict>
14+
</plist>

MHC博客/Classes/View/Home/WebSocket/WebSocketViewController.swift

+12-8
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@ override var preferredContainerBackgroundStyle: UIContainerBackgroundStyle {
5252
table.register(TableViewCell.self, forCellReuseIdentifier: "MsgCell")
5353
//数据协议
5454
//代理方法
55+
textField.snp.makeConstraints { make in
56+
make.bottom.equalTo(textField.frame.height)
57+
make.width.equalTo((UIScreen.main.bounds.width - self.sendButton.frame.width) / 2)
58+
make.centerX.equalTo(self.table.snp.centerX)
59+
}
5560
table.chatDataSource = self
56-
textField.snp.makeConstraints { make in
57-
make.left.equalTo(20)
58-
make.bottom.equalTo(view.snp.bottom).offset(-10)
59-
}
60-
sendButton.snp.makeConstraints { make in
61-
make.left.equalTo(textField.snp.right)
62-
make.bottom.equalTo(textField.snp.bottom)
63-
}
61+
sendButton.snp.makeConstraints { make in
62+
make.left.equalTo(textField.snp.right)
63+
make.bottom.equalTo(textField.snp.bottom)
64+
}
6465
table.snp.makeConstraints { make in
6566
make.bottom.equalTo(sendButton.snp.top).offset(-20)
6667
make.left.equalTo(view.snp.left).offset(20)
@@ -78,9 +79,12 @@ override var preferredContainerBackgroundStyle: UIContainerBackgroundStyle {
7879
sendButton.layer.cornerRadius = 15
7980
sendButton.layer.masksToBounds = true
8081
textField.placeholder = NSLocalizedString("说些话吧,哪怕是一个标点符号也行...", comment: "")
82+
8183
sendButton.setTitle(NSLocalizedString("发送", comment: ""), for: .normal)
8284
sendButton.setTitleColor(.white, for: .normal)
8385
sendButton.backgroundColor = .red
86+
textField.textAlignment = .natural
87+
textField.adjustsFontSizeToFitWidth = true
8488
textField.sizeToFit()
8589
sendButton.sizeToFit()
8690
let leftbar = UIBarButtonItem(image: nil, style: .plain, target: self, action: #selector(self.close))

MHC博客/Localized/Localizable.xcstrings

+2-2
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@
747747
"en" : {
748748
"stringUnit" : {
749749
"state" : "translated",
750-
"value" : "Register as an user at Mhc Boke"
750+
"value" : "Register"
751751
}
752752
}
753753
}
@@ -889,7 +889,7 @@
889889
"en" : {
890890
"stringUnit" : {
891891
"state" : "translated",
892-
"value" : "Log in Mhc Boke"
892+
"value" : "Login"
893893
}
894894
}
895895
}

MHC博客/Resource/nginx.conf

+6-14
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,12 @@ http {
7676
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
7777
#
7878
location ~ \.php$ {
79-
root html;
80-
fastcgi_pass 127.0.0.1:9000;
81-
fastcgi_index index.php;
82-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
83-
include fastcgi_params;
84-
}
85-
location / {
86-
root html;
87-
index index.html index.htm index.php;
88-
if (!-e $request_filename) {
89-
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
90-
rewrite ^(.*)$ /index.php?s=$1 last;
91-
break;
92-
}
79+
include fastcgi.conf;
80+
fastcgi_index index.php;
81+
fastcgi_pass 127.0.0.1:9000;
82+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
83+
include fastcgi_params;
84+
include fastcgi.conf;
9385
}
9486
# deny access to .htaccess files, if Apache's document root
9587
# concurs with nginx's one
+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
2+
#user nobody;
3+
worker_processes 1;
4+
worker_rlimit_nofile 65535;
5+
6+
7+
#pid logs/nginx.pid;
8+
9+
10+
events {
11+
worker_connections 10000;
12+
}
13+
rtmp {
14+
server {
15+
listen 1935;
16+
notify_method get;
17+
18+
application live {
19+
live on;
20+
hls on;
21+
hls_path /opt/homebrew/var/www/video/;
22+
hls_fragment 5s;
23+
on_publish http://127.0.0.1/api/live.php; #推流验证
24+
on_publish_done http://127.0.0.1/api/endLive.php;
25+
}
26+
}
27+
}
28+
29+
http {
30+
include mime.types;
31+
default_type application/octet-stream;
32+
33+
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
34+
# '$status $body_bytes_sent "$http_referer" '
35+
# '"$http_user_agent" "$http_x_forwarded_for"';
36+
client_max_body_size 0;
37+
#access_log logs/access.log main;
38+
39+
sendfile on;
40+
tcp_nopush on;
41+
tcp_nodelay on;
42+
43+
#keepalive_timeout 0;
44+
keepalive_timeout 65;
45+
46+
#gzip on;
47+
48+
server {
49+
listen 80;
50+
server_name localhost;
51+
52+
#charset koi8-r;
53+
54+
#access_log logs/host.access.log main;
55+
56+
location /hls {
57+
types {
58+
application/vnd.apple.mpegurl m3u8;
59+
}
60+
alias /opt/homebrew/var/www/video/;
61+
add_header Cache-Control no-cache;
62+
add_header Access-Control-Allow-Origin *;
63+
}
64+
location /stat { rtmp_stat all; rtmp_stat_stylesheet stat.xsl; }
65+
66+
location /stat.xsl { root www; }
67+
#error_page 404 /404.html;
68+
69+
# redirect server error pages to the static page /50x.html
70+
#
71+
error_page 500 502 503 504 /50x.html;
72+
location = /50x.html {
73+
root html;
74+
}
75+
76+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
77+
#
78+
location ~ \.php$ {
79+
root html;
80+
fastcgi_pass 127.0.0.1:9000;
81+
fastcgi_index index.php;
82+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
83+
include fastcgi_params;
84+
}
85+
location / {
86+
root html;
87+
index index.html index.htm index.php;
88+
if (!-e $request_filename) {
89+
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
90+
rewrite ^(.*)$ /index.php?s=$1 last;
91+
break;
92+
}
93+
}
94+
# deny access to .htaccess files, if Apache's document root
95+
# concurs with nginx's one
96+
#
97+
#location ~ /\.ht {
98+
# deny all;
99+
#}
100+
}
101+
102+
103+
# another virtual host using mix of IP-, name-, and port-based configuration
104+
#
105+
server {
106+
# listen 8000;
107+
# listen somename:8080;
108+
# server_name somename alias another.alias;
109+
110+
# location / {
111+
# root html;
112+
# index index.html index.htm;
113+
# }
114+
#}
115+
116+
117+
# HTTPS server
118+
#
119+
#server {
120+
# listen 443 ssl;
121+
# server_name localhost;
122+
123+
# ssl_certificate cert.pem;
124+
# ssl_certificate_key cert.key;
125+
126+
# ssl_session_cache shared:SSL:1m;
127+
# ssl_session_timeout 5m;
128+
129+
# ssl_ciphers HIGH:!aNULL:!MD5;
130+
# ssl_prefer_server_ciphers on;
131+
132+
# location / {
133+
# root html;
134+
# index index.html index.htm;
135+
# }
136+
#}
137+
include servers/*;
138+
}
139+
}

MHC博客/project/wss/.idea/misc.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MHC博客/project/wss/pom.xml

-9
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,4 @@
4343
</dependency>
4444
</dependencies>
4545

46-
<build>
47-
<plugins>
48-
<plugin>
49-
<groupId>org.springframework.boot</groupId>
50-
<artifactId>spring-boot-maven-plugin</artifactId>
51-
</plugin>
52-
</plugins>
53-
</build>
54-
5546
</project>

readme.md

+21-14
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ Installation
1414

1515
You can download the zip or clone this repository.
1616

17-
**改进了直播的方面,将@后更改为用户的MID,以便我们实现升起视图控制器来查看用户信息,将富文本FFLabelDelegate在评论区无法正常点击的bug fixed,同时在一段时间后会添加查看话题的api(敬请期待)将nginx、php配置放在了Resource内,将ip统一为localhost,可以通过以下配置,删除了addComment、deleteComment,将内容统一分别添加到upload、deleteBlog,CommentViewController删除,统一改为ComposeViewController,删除Comment,统一改为Status,删除CommentViewModel,改为StatusViewModel,删除关于CommentCommentCell、CommentCommentCellBottomView、StatusCommentCell,统一改为StatusNormalCell,评论可以发送图片、创建话题、将中心button删除,改为右上角的笔,不容易出现约束问题**
17+
**改进了直播的方面,将@后更改为用户的MID,以便我们实现升起视图控制器来查看用户信息,将富文本FFLabelDelegate在评论区无法正常点击的bug fixed,同时在一段时间后会添加查看话题的api(敬请期待)将nginx、php配置放在了Resource内,将ip统一为localhost,可以通过以下配置,删除了addComment、deleteComment,将内容统一分别添加到upload、deleteBlog,CommentViewController删除,统一改为ComposeViewController,删除Comment,统一改为Status,删除CommentViewModel,改为StatusViewModel,删除关于CommentCommentCell、CommentCommentCellBottomView、StatusCommentCell,统一改为StatusNormalCell,评论可以发送图片、创建话题、将中心button删除,改为右上角的笔,不容易出现约束问题,注意!记得将所有的内容都测试,否则可能注销会因为数据库没有统一创建导致出现用户没有成功注销的问题,本人在考虑要不要统一建数据库在一个文件**
1818

1919
```brew install nginx-full```
2020

2121
```brew install php```
2222

23-
```brew services start nginx-full```
23+
```brew install mysql```
2424

25-
**resource内的nginx.conf替换到/opt/homebrew/etc/nginx.conf**
25+
```brew services start php```
26+
27+
```brew services start mysql```
28+
29+
**resource内的nginx.conf替换到/opt/homebrew/etc/nginx.conf,old_version为macOS 15.0以下**
2630

2731
```nginx -s /opt/homebrew/etc/nginx.conf```
2832

@@ -34,7 +38,11 @@ You can download the zip or clone this repository.
3438

3539
**project内的wss项目(springboot)运行,用于连接websocket**
3640

37-
**如何更改配置**
41+
**如何启动**
42+
43+
```nginx```
44+
45+
**如何重载**
3846

3947
```nginx -s reload```
4048

@@ -45,16 +53,15 @@ Stories
4553

4654
**一个轻量的博客,我们可以在世界各地向手机分享不同的瞬间!例如可以分享出去游玩的照片、快乐的瞬间,点赞高的还有可能在退出app时被被精选哦**
4755

48-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/37/cc/e5/37cce569-cfab-d509-f3c8-9725018b207b/e6bfac15-617d-45f1-a966-49b265d80dc8_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_10.58.50.png/400x800bb.png)
49-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/f4/aa/3e/f4aa3e8a-2c7b-50dc-09f3-5cdd1442cb0f/34a6c79b-3d6d-4d8b-bdcc-7d442bd9d4b2_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_10.59.32.png/400x800bb.png)
50-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/d2/90/9e/d2909ed3-3cf6-4f23-f3ed-6d32f15a0a16/1d3e92fa-5a69-4bee-9917-7a026dba488b_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_10.59.44.png/400x800bb.png)
51-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/86/df/b0/86dfb0e2-c114-195e-7bc2-ed6a36c2c7f6/418b53f9-6a1e-4504-97c0-cb952b2e21c3_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_10.59.48.png/400x800bb.png)
52-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/72/3d/59/723d5909-33d2-5d82-3913-b10d0c7adca2/53e9cccf-d3c4-4bee-b06f-537658b7cf6a_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_10.59.53.png/400x800bb.png)
53-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/6f/e0/0b/6fe00b15-4729-2b02-7369-e6cc6b003f7d/fac6e250-14a9-43fb-ab42-8d2fe54c11b5_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_11.02.51.png/400x800bb.png)
54-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/98/81/5c/98815cfa-bc38-29ce-1341-556e94873206/884ae8e7-5a75-4ff5-bf03-1c61ed33064f_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_11.03.23.png/400x800bb.png)
55-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/6c/5e/f5/6c5ef5a7-7cf8-7725-4033-3bd870364f6d/7991c427-d0e9-4831-94ea-a83a30d3045d_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_11.34.33.png/400x800bb.png)
56-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource211/v4/df/eb/b1/dfebb17d-fc1a-3128-ab7f-ecd5ebf192bf/96726472-6638-4ad8-93a8-c610d182ceaf_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_11.35.16.png/400x800bb.png)
57-
![avatar](https://is1-ssl.mzstatic.com/image/thumb/PurpleSource221/v4/69/95/09/699509a1-9561-97dd-b50c-043c6f3ef0c4/ba8372c9-fdfb-41ca-bb8a-05c0eed01b86_Simulator_Screenshot_-_iPhone_14_Plus_-_2024-03-31_at_11.35.58.png/400x800bb.png)
56+
![avatar](https://www.z4a.net/image/ja8IwK)
57+
![avatar](https://www.z4a.net/image/ja8Mc0)
58+
![avatar](https://www.z4a.net/image/ja8Prj)
59+
![avatar](https://www.z4a.net/image/ja8hOa)
60+
![avatar](https://www.z4a.net/image/jaCSCO)
61+
![avatar](https://www.z4a.net/image/jaCfNK)
62+
![avatar](https://www.z4a.net/image/jaCvu0)
63+
![avatar](https://www.z4a.net/image/jaC3Jj)
64+
5865
**一个轻量的博客,我们可以在世界各地向手机分享不同的瞬间!**
5966

6067
Copyright © Mhc.

0 commit comments

Comments
 (0)