分类
日常记录

iOS Simulator APP 沙盒地址

进入模拟器目录

cd ~/Library/Developer/CoreSimulator/Devices/<identifier>/data/Containers/Data/Application

搜索 APP 名字或者其他想要查找的文件

find ./ -name '*.sqlite'
分类
日常记录

PhpStorm 非 static 方法 ‘where’ 不应被静态调用,但类具有 ‘__magic’ 方法。

在使用 ThinkPHP 的时候,默认 PhpStorm 会提示 非 static 方法 'where' 不应被静态调用,但类具有 '__magic' 方法。

去掉这个检查即可。

分类
日常记录

IntelliJ IDEA 常用插件

以下插件是我一定会安装的插件

Atom Material Icons

Chinese ​(Simplified)​ Language Pack / 中文语言包

CodeGlance Pro

Rainbow Brackets

Rider UI Theme Pack

Tabnine AI Code Completion- JS Java Python TS Rust Go PHP & More

PlantUML Integration

分类
日常记录

收藏的正则表达式

匹配一个字符到另一个字符,尽可能短的匹配。

/[(].*?[)]/g
'回绝(做某事),绝(做某事),'.replace(/[?<=(].*?[?=)]/g,'')

输出内容:

‘回绝,绝,’

分类
日常记录

Ant Design Pro 宝塔 Nginx 部署

设置为静态即可:

# 用于配合 browserHistory使用    
location / {
    try_files $uri $uri/ /index.html;
}
# 接口代理
location /api/ {
    proxy_pass https://lane.guodapeng.icu/api/;
}
分类
日常记录

宝塔 反向代理

在部署 Docker、Node.js 项目时,或者 java 项目的时候,经常会使用反向代理来给项目映射一个域名,使用 80 端口进行访问。这样有很多好处,至少看起来很舒服。

下面是在使用宝塔的时候,如何进行反向代理的截图。

那么为什么使用宝塔呢?

其实原因很简单,我不会手动配置反向代理……

分类
日常记录

spring boot 的报错

1.dao 字段名字没映射好

...

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-09-03 19:39:23.978 ERROR 28777 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract com.gdp.demo3.entity.User com.gdp.demo3.dao.UserDao.findByUsername(java.lang.String)!

...

大概这样一段报错,实际是我数据库和实体类字段没对应上。

package com.xxx.xxx.entity

import java.util.*
import javax.persistence.*
import javax.validation.constraints.NotEmpty
import javax.validation.constraints.Size

@Table(name = "user")
@Entity
class User {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    var id: Long = -1

    @Column(unique = true)
    @NotEmpty(message = "用户名不能为空")
    @Size(message = "用户名长度在1~20之间", max = 100, min = 1)
    var userName: String = ""

    @NotEmpty(message = "密码不能为空")
    @Size(message = "密码长度在6~100之间", max = 100, min = 6)
    var password: String = ""
}

数据库中 userName 是全部小写,没有任何分割符的,改成 username 就好了。

2.Freemarker 页面老是 404

Spring Boot 2.3.3 的时候发现的,Freemarker 的默认后缀发生了变化,以前可能是 .ftl,现在是 .ftlh。可能是这个造成不能找的模板的。

application.properties 文件设置 spring.freemarker.suffix=.ftlh 可以自己随意设置后缀。

spring boot 的报错

分类
日常记录

IntelliJ IDEA 写 spring boot 代码 处理 Cannot resolve table ‘xxx’ 警告

大概长这样:

解决办法:

解决后的效果:

IntelliJ IDEA 写 spring boot 代码 处理 Cannot resolve table ‘xxx’ 警告

分类
日常记录

iOS 升级了测试版本 电脑不想升级 真机调试 Flutter 应用

iOS升级了开发者版本。这个时候调试 Flutter 会见到下面这段日志。

Launching lib/main.dart on 郭大鹏的iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: BBAXGSNKQ3
Running Xcode build...
Xcode build done.                                           29.1s
Installing and launching...                                     




Installing and launching...                                        13.1s
2020-07-07 14:43:14.160 ios-deploy[28235:306916] [ !! ] Unable to locate DeviceSupport directory with suffix 'DeveloperDiskImage.dmg'. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!
Could not run build/ios/iphoneos/Runner.app on d0801019273b8ab47b043e04519da43b76a32c03.
Try launching Xcode and selecting "Product > Run" to fix the problem:
  open ios/Runner.xcworkspace

Error launching application on 郭大鹏的iPhone.

调试没成功。这个时候不要慌,下载开发者版本的 Xcode 里面有你需要的。

➜  DeviceSupport pwd
/Users/felix/Downloads/Xcode-beta.app/Contents/Developer/platforms/iPhoneOS.platform/DeviceSupport
➜  DeviceSupport sudo cp -R 14.0  /Applications/Xcode.app/Contents/Developer/platforms/iPhoneOS.platform/DeviceSupport
Password:

大概的意思是 Xcode 软件的 Contents/Developer/platforms/iPhoneOS.platform/DeviceSupport 这个目录里面,有各个 iOS 版本对应的文件,复制过去,就可以了。

Launching lib/main.dart on 郭大鹏的iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: BBAXGSNKQ3
Running Xcode build...
Xcode build done.                                           25.5s
Installing and launching...                                        27.4s
Debug service listening on ws://localhost:1024/ws
Syncing files to device 郭大鹏的iPhone...

然后就成功了。

iOS 升级了测试版本 电脑不想升级 真机调试 Flutter 应用

分类
日常记录

Homebrew 安装 node

安装最新版本:

brew install node

安装指定版本:

brew install node@12

安装后可能不能使用。有一些提示。不过有一条命令可以比较简单的让 node 可以直接使用。

brew link --overwrite --force node12

Homebrew 安装 node