洪海涛 3 роки тому
батько
коміт
0f7deef1cd

+ 59 - 0
README.md

@@ -64,3 +64,62 @@ pip3 install mysqlclient
 - 权限满足
 - 模式正确
 
+## 部署
+参考地址:https://www.dusaiphoto.com/article/71/
+
+ssl授权证书(free):https://certbot.eff.org/#ubuntutyakkety-nginx
+
+### 生产环境依赖
+- mysql:latest
+- django:4.x
+- nginx:latest
+
+### nginx 配置
+```
+server {
+  # listen       [::]:80;
+  server_name  www.suzuran.fun;
+  root         /usr/share/nginx/html;
+
+  # Load configuration files for the default server block.
+  include /etc/nginx/default.d/*.conf;
+
+	location / {
+		proxy_pass  http://127.0.0.1:8000; # 转发规则
+		proxy_set_header Host $proxy_host; # 修改转发请求头,让8080端口的应用可以受到真实的请求
+    		proxy_set_header X-Real-IP $remote_addr;
+    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+	}
+
+    error_page 404 /404.html;
+        location = /40x.html {
+    }
+
+    error_page 500 502 503 504 /50x.html;
+        location = /50x.html {
+    }
+}
+```
+
+### 项目依赖
+
+#### 配置依赖项
+pip freeze > requirements.txt
+
+#### 省级pip3
+pip3 install --upgrade pip
+
+#### 安装库
+pip3 install -r requirements.txt
+
+- 安装依赖过程中会提示版本不对,就把版本号改一下
+- 安装mysqlclient会保一些问题:安装mysqlclient提示mysql_config not found问题:https://www.cnblogs.com/yoyoketang/p/12131101.html
+
+#### 收集静态资源
+python3 manage.py collectstatic
+
+#### 数据库迁移
+python3 manage.py migrate
+
+### 启动(保存后台运行)
+gunicorn admin_site.wsgi:application -D

+ 2 - 0
Recycle/pages/registered/index.wxml

@@ -13,6 +13,8 @@
 
   <t-input wx:if="{{user_type === 'FL002'}}" label="slot" model:value="{{car}}"><text slot="label">车牌号<text style="color: #e34d59"> *</text></text></t-input>
 
+  <t-input wx:if="{{user_type == 'FL001' && user_type}}" label="slot" model:value="{{address}}"><text slot="label">地址<text style="color: #e34d59"> *</text></text></t-input>
+
   <t-input wx:if="{{user_type !== 'FL001' && user_type}}" label="slot" model:value="{{address}}"><text slot="label">回收站<text style="color: #e34d59"> *</text></text></t-input>
 </view>
 

+ 1 - 1
Recycle/project.config.json

@@ -46,7 +46,7 @@
     },
     "compileType": "miniprogram",
     "libVersion": "2.19.4",
-    "appid": "wxa5037fd79e107786",
+    "appid": "wxae539ee7ef73b369",
     "projectname": "miniprogram-92",
     "condition": {},
     "editorSetting": {

+ 1 - 1
Recycle/utils/request.js

@@ -2,7 +2,7 @@ const base = ({ url, method, data }) => {
   return new Promise((resolve, reject) => {
     wx.request({
       // url: "http://127.0.0.1:8000" + url,
-      url: "http://192.168.4.51:8000" + url,
+      url: "https://www.suzuran.fun" + url,
       method,
       data,
       header: {