V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  drymonfidelia  ›  全部回复第 59 页 / 共 66 页
回复总数  1303
1 ... 51  52  53  54  55  56  57  58  59  60 ... 66  
325 天前
回复了 imdong 创建的主题 职场话题 sudo pkill -9 job; cd ~
usage: scp [-346ABCOpqRrsTv] [-c cipher] [-D sftp_server_path] [-F ssh_config]
[-i identity_file] [-J destination] [-l limit]
[-o ssh_option] [-P port] [-S program] source ... target

scp 没有-a 参数
@CLMan #40 的代码可以用,谢谢
@CLMan 谢谢 今天放假了,在路上没有电脑测试
327 天前
回复了 imdong 创建的主题 职场话题 sudo pkill -9 job; cd ~
scp -r /home/ usa:/home/ && /var/run/airplane
@kkk9 他需要在 webview 里放置同公司其它组的业务页面,很有可能这些页面是服务器渲染的,你替换掉原来的 fetch ,加载页面又不会调用 fetch ,没用
@lisongeee
@githmb 前端代码是其它部门写好的 哪有办法说改就改
@wangpao 想测试下 iOS 相册有没有解码 RMVB 的能力
@dandycheung 这个中文分词问题很多 例如 1 楼的回复 在 firefox 的分词是 内 置 一个 字典 就好 内置被拆开了
@araraloren 看什么都钓鱼 我要钓鱼写这么长代码干什么 能钓鱼的话题多了去了
@1145148964 100%不行,我 4 个月前测试的,今天把相册全导入进 mac 然后清空才发现这个问题
@dcsuibian 我们公司是交代的事情干完了,上班时间看 AV 都没人管你
@NessajCN 「我要做一个专用浏览器」应该是比「选一个现成浏览器好方便地显示我们的网页」更底层的需求,我认为是应该更能实现改个默认请求头这种简单需求
@NessajCN 但是我的目的就是拿来当套壳浏览器,之前我的 /t/989348 /t/1011628 两个帖子都很多人无脑推荐 tauri 。
同需求 Electron 就能非常方便实现
@NessajCN 编译好了,请求头还是没设置上 https://i.imgur.com/LdruUj9.png

```
use reqwest::header::HeaderValue;
use tauri::Manager; // Import the Manager trait
fn main() {
struct ReqClient {
client: reqwest::Client,
}
impl ReqClient {
fn new(client: reqwest::Client) -> Self {
Self { client }
}
}

tauri::Builder::default().setup(|app| {
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("app-name", reqwest::header::HeaderValue::from_static("my-app"));
headers.insert("app-ver", reqwest::header::HeaderValue::from_static("1.0-win"));
headers.insert("app-iver", reqwest::header::HeaderValue::from_static("20240202-01M"));

let client = reqwest::Client::builder()
.default_headers(headers)
.build()
.unwrap();
app.manage(ReqClient::new(client));
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
```
@ie88 tauri 只是拿来当套壳浏览器,不能改动现有网页代码
@NessajCN 编译不了啊 failed to resolve: use of undeclared crate or module `reqwest` 全替换成 request 也不行
```
fn main() {
struct ReqClient {
client: request::Client

}
impl ReqClient {
fn new(client: request::Client) -> Self {
Self {client}
}
}
tauri::Builder::default()
.setup( |app| {
let mut headers = request::header::HeaderMap::new();
headers.insert("app-name", header::HeaderValue::from_static("my-app"));
headers.insert("app-ver", header::HeaderValue::from_static("1.0-win"));
headers.insert("app-iver", header::HeaderValue::from_static("20240202-01M"));

let client = request::Client::builder().default_headers(headers).build().unwrap();
app.manage(ReqClient::new(client));
})
}
```
```
error[E0433]: failed to resolve: use of undeclared crate or module `request`
--> src\main.rs:20:22
|
20 | let client = request::Client::builder().default_headers(headers).build().unwrap();
| ^^^^^^^ use of undeclared crate or module `request`

error[E0433]: failed to resolve: use of undeclared crate or module `request`
--> src\main.rs:15:27
|
15 | let mut headers = request::header::HeaderMap::new();
| ^^^^^^^ use of undeclared crate or module `request`
|
help: consider importing this struct
|
1 + use tauri::http::header::HeaderMap;
|
help: if you import `HeaderMap`, refer to it directly
|
15 - let mut headers = request::header::HeaderMap::new();
15 + let mut headers = HeaderMap::new();
|

error[E0433]: failed to resolve: use of undeclared crate or module `header`
--> src\main.rs:16:36
|
16 | headers.insert("app-name", header::HeaderValue::from_static("my-app"));
| ^^^^^^ use of undeclared crate or module `header`
|
help: consider importing this struct
|
1 + use tauri::http::header::HeaderValue;
|
help: if you import `HeaderValue`, refer to it directly
|
16 - headers.insert("app-name", header::HeaderValue::from_static("my-app"));
16 + headers.insert("app-name", HeaderValue::from_static("my-app"));
|

error[E0433]: failed to resolve: use of undeclared crate or module `header`
--> src\main.rs:17:35
|
17 | headers.insert("app-ver", header::HeaderValue::from_static("1.0-win"));
| ^^^^^^ use of undeclared crate or module `header`
|
help: consider importing this struct
|
1 + use tauri::http::header::HeaderValue;
|
help: if you import `HeaderValue`, refer to it directly
|
17 - headers.insert("app-ver", header::HeaderValue::from_static("1.0-win"));
17 + headers.insert("app-ver", HeaderValue::from_static("1.0-win"));
|

error[E0433]: failed to resolve: use of undeclared crate or module `header`
--> src\main.rs:18:36
|
18 | headers.insert("app-iver", header::HeaderValue::from_static("20240202-01M"));
| ^^^^^^ use of undeclared crate or module `header`
|
```
错误太多了贴不完
@roycestevie6761 但凡他的 star 数少一点,我早就放弃折腾了
@roycestevie6761 正常 v 友推荐的灵车我是不敢碰的,但是 tauri GitHub 上有 73.5k star 感觉很成熟了,试了下,没想到连改个默认请求头都做不到
1 ... 51  52  53  54  55  56  57  58  59  60 ... 66  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2923 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms · UTC 11:18 · PVG 19:18 · LAX 03:18 · JFK 06:18
Developed with CodeLauncher
♥ Do have faith in what you're doing.