404-page 相关问题


Java Web App - 尝试运行 JSP 文件 (IntelliJ) 时出现错误 404

当我尝试运行 JSP 文件(右键单击文件名并在 IntelliJ 中运行)时,我得到 404 我的JSP代码: `<%@ page contentType="text/html; charset=ISO-8859-1" pageEncoding=...


.htaccess WordPress 站点中的分页重定向规则

人们! 我想将网址从“https://some-domain.com/.../?product-page=some-page-number”更改为“https://some-domain.com/.../page” /some-page-number" 使每个动态 p...


使用 AzureOpenAI 凭据找不到 Langchain OpenAIEmbeddings 资源 (404)

我在使用带有 Azure OpenAI 凭据的 LangChain 嵌入时遇到问题 - 它显示 404 错误,表示找不到资源。 堆栈跟踪:错误:404 找不到资源 在 APIError.generate (c:\


Spring Boot JSP 404.Whitelabel 错误页面

无法使用 spring-boot 加载非常简单的 JSP 页面,出现 404 Not Found HmisApplication.class @SpringBootApplication 公共类 HmisApplication 扩展 SpringBootServletInitializer { @覆盖


404 错误 - 尝试访问我的 Servlet 时显示错误

主页工作正常,但是,当我尝试访问我正在测试的两个 servlet 之一时,出现 404 错误。我使用IDE intellij,tomcat 9,maven,servlet版本5, HTTP 状态 404...


修改现有的.htaccess,使其忽略子域

我有以下 .htaccess 文件,虽然我知道它远非最佳(并且可能有点令人畏惧) - 它只是有效。 # 防止公众查看 .htaccess 文件 我有以下 .htaccess 文件,虽然我知道它远非最佳(而且可能有点令人难受) - 它只是有效。 # Prevents public viewing of .htaccess file <Files .htaccess> order allow,deny deny from all </Files> # Custom 404 page ErrorDocument 404 https://www.domain.com/404/ # Turn on rewriting and set rewriting base RewriteEngine On RewriteBase / # Force WWW RewriteCond %{HTTP_HOST} !^$ RewriteCond %{HTTP_HOST} ^([^.]+)\.([a-z]{2,4})$ [NC] RewriteCond %{HTTPS}s ^on(s)| RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=302,L] # Force WWW and HTTPS RewriteCond %{HTTP_HOST} !^www\. [NC,OR] RewriteCond %{HTTPS} off RewriteRule ^ https://www.domain.com%{REQUEST_URI} [R=301,L] # Remove .php extension RewriteRule ^(properties)/(all|location1|location2|location3)/(all|1|2|3|4|5|6|7|8|9)/(asc|desc) $1.php?location=$2&bedrooms=$3&sort-by=$4 RewriteRule ^(properties)/(all|location1|location2|location3)/(all|1|2|3|4|5|6|7|8|9) $1.php?location=$2&bedrooms=$3 RewriteRule ^(properties)/(all|location1|location2|location3) $1.php?location=$2 RewriteRule ^(view-property)/(.*)/(print-view) $1.php?id=$2&print=true RewriteRule ^(view-property)/(.*)/ $1.php?id=$2 RewriteRule ^(.*)/$ $1.php 我们的新网站现已准备好推送到我们新创建的临时环境中进行测试。在本例中,它会是 staging.domain.com,但我们在实际访问此暂存 URL 时遇到问题。 编辑 - 只是为了澄清,问题是访问 staging.domain.com 重定向到 https://www.domain.com。 我们认为问题是由我们上面的重写规则引起的。我研究了一些可能的解决方案,包括向现有重写规则添加附加条件,例如: RewriteCond %{HTTP_HOST} !^staging\.domain\.com 或添加新的条件/规则,例如: RewriteCond %{HTTP_HOST} ^staging\.domain\.com [NC] RewriteRule ^(.*) - [L] 但不幸的是这些都不起作用。使用 .htaccess 文件确实不是我的强项,所以如果有人可以提供任何帮助,那就太好了。 附注新网站由 Laravel 5.3 提供支持,因此当我们上线时,我将摆脱重写规则(位于底部的规则)的可怕尝试! 您的顶级规则必须更改为此以删除目标 URL 中的硬编码域名: # Turn on rewriting and set rewriting base RewriteEngine On RewriteBase / # Force WWW and HTTPS RewriteCond %{HTTP_HOST} !^www\. [NC,OR] RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L,NE] # Remove .php extension and rest of the rewrite rules Crypto.com 登录问题 已经是 crypto.com 登录用户?继续作为 crypto.com 登录问题用户。或者。电子邮件。密码。登录 忘记密码?没有帐户?立即注册。注册 Crypto.com NFT 帐户 · 连接您经过验证的 crypto.com 登录问题 · 提交申请成为创建者 Trezor suite 应用程序 移动版 Trezor Suite Lite 是一款免费应用程序,可让您同步和跟踪所有比特币和加密货币您手机上的帐户。适用于 Trezor 硬件钱包的新桌面和浏览器应用程序。 Trezor Suite 在可用性、安全性和隐私这三个关键支柱上带来了重大改进。


除特快路线外,均出现404错误

我实现了react和express项目来进行简单的部署测试。 但是,只有快速路由(“/”)有响应,其他路由会出现 404 错误。 反应何...


Nginx 正则表达式如果 url 以单词结尾则返回 404

类似 /admin/somefile 的 URL?某些参数应该可以工作 像 /admin/somefile?someparameters#authorize 这样的 URL 应该返回 404 所以我在网址末尾寻找“#authorize” 现在我是


Spring Cloud Gateway 返回 404 未找到错误

我尝试使用 Reactive 和 MVC Spring Cloud API 网关,但在两次尝试中我都在 Postman 中收到 404 Not Found 错误响应。 我只有一个用户服务和一个发现服务器(尤里卡)...


如何在sed命令中使用正则表达式

我在某些文件中有一些具有这种模式的字符串: 域名.com/page-10 域名.com/page-15 .... 我想用类似的东西替换它们 域名.com/apple-10.html 域名.com/apple-15.html 我


由于 URL 构造不正确(404 Not Found),React 组件未显示获取的数据

我正在开发一个 React 组件,以使用 Axios 从 Django REST Framework API 获取数据。但是,该组件没有显示获取的数据,并且我遇到了 404 Not Found 错误...


servlet 中的 Http 错误 404:找不到该网址的网页

PrintNamesServlet.java: 该 Servlet 打印输入的用户名称。 导入 javax.servlet.ServletException; 导入 javax.servlet.annotation.WebServlet; 导入 javax.servlet.http.HttpServlet; 我...


刷新非登陆页面时出现404错误(react应用程序部署在gh页面上)

我在 github 页面上部署了一个 React 应用程序,一切正常,直到我刷新一个不是登陆页面的页面。我收到 404 错误。有谁知道是什么原因造成的?我会包括主要的鳕鱼...


如何从 default.master 获取其他内容页面的标题?

我的前文件夹有一个default.Master page和一些其他aspx文件,例如登录。 默认.Master: <%@Master language="C#" CodeBehind="~/default.Master.cs" Inherits="Front.


旋转期间不考虑 SwiftUI TabView 插入

对于 Carousel 自定义组件,我们使用具有以下修饰符的 TabView: .tabViewStyle(.page(indexDisplayMode: .never)) 一切都工作得很好,除了在旋转期间...


Prometheus 目标返回 http 状态 404 未找到

我想将 Jenkins 与 Prometheus 集成,并在 Jenkins 上安装 Prometheus 插件,并在 Prometheus 中设置以下配置。 Prometheus 上的目标显示“服务器重新...


R rvest read_html() 返回几乎空的页面

我想使用 R、rvest 和 httr 包抓取此页面上的广告链接:https://reality.idnes.cz/s/?page=1。它返回我不明白的结果。 代码是: 链接<- "https://r...


Ngrok“HTTP 错误 404”。找不到所请求的资源

错误图片 我尝试使用“ngrok”执行我的 django-app。添加了 url 到“ALLOWED_HOSTS”和其他需要的变量。我做了“py manage.py runserver”和“ngrok http ...


使用 docker 选项运行 Docker 容器

当通过Jelastic运行Docker容器时,docker run命令由什么组成? 我在该平台上测试过 Docker 容器,它们始终显示 404 错误,支持有


OpenAI API 未给出响应

我尝试使用 openAI api 构建 chatgpt 克隆,但我在 api 的响应 paylaod 中收到 404 错误代码。我尝试了多种选择,但没有找到任何解决方案......


GA4 配置发送浏览器标题而不是 CustomVirtualPageTitle

我已按照本指南中提到的步骤进行操作:https://www.analyticsmania.com/post/single-page-web-app-with-google-tag-manager/ 每当用户导航时 dataLayer.push 代码页面/st之间...


具有多个值的JS var

有件事我无法理解: 我有一个打开同一页面的功能,但具有不同的内容,具体取决于菜单中单击的按钮: 有件事我无法理解: 我有一个打开同一页面的功能<div id="page">但具有不同的内容,具体取决于菜单中单击的按钮: <nav> <button onclick="openPage(1)">PAGE 1</button> <button onclick="openPage(2)">PAGE 2</button> <button onclick="openPage(3)">PAGE 3</button> </nav> 然后是函数: function openPage(p){ var move=0; // define a var for USER action if(p==1){ document.getElementById('page').innerHTML = text_1; // content preloaded } else if(p==2){ document.getElementById('page').innerHTML = text_2; } else if(p==3){ document.getElementById('page').innerHTML = text_3; } // then on the top of the page (absolute + z-index) I add a HTML object: document.getElementById('page').innerHTML += '<aside id="pictures">content</aside>'; // what I'm now trying to do is to remove this object once USER move its mouse on it document.getElementById('pictures').addEventListener("mousemove",function(event) { setTimeout(function(){ move+=1; // increase the val each second },1e3) console.log('move'+p+' = '+move) // control value if(move>100){ document.getElementById('pictures').style.display = "none"; // OK, it works move=0; // reinit the var } }); } 现在惊喜: 第 1 页的控制台 move1 = 0 move1 = 1 ... move1 = 99 move1 = 100 // 'pictures' disappears 第 2 页的控制台 move1 = 41 move2 = 0 ... move1 = 58 move1 = 17 ... move1 = 100 // 'pictures' disappears move2 = 59 第 3 页的控制台 move1 = 15 move2 = 88 move3 = 0 ... move1 = 37 move2 = 100 // 'pictures' disappears move3 = 12 ... 我的 var 'move' 同时获得 3 个值...这怎么可能? 您的问题的原因是您每次调用 openPage 函数时都会添加一个事件侦听器。这意味着,如果您单击多个按钮,每个按钮都会有自己的事件侦听器附加到 #pictures 元素。现在,当触发 mousemove 事件时,所有这些侦听器将同时执行,导致 move 变量每秒递增多次。 解决此问题的方法是在添加新事件侦听器之前先删除现有的事件侦听器。 let handler; // to hold the event listener function const pictureEl = document.getElementById('pictures'); function openPage(p){ // Remove existing event listener if (handler) { // <-- Check here pictureEl.removeEventListener("mousemove", handler); } handler = function(event) { // ...Rest } }; // Add new event listener pictureEl.addEventListener("mousemove", handler); // ...rest 找到了另一种(最简单的?)方法: var move=0; // placed out of functions function openPage(p){ .... (same as previous) getElementById('pictures').addEventListener("mousemove",outPicts); // change } // put mousemove event in another function: function outPicts(p){ setTimeout(function(){ move+=1; },1e3) console.log('move = '+move) if(move>100){ document.getElementById('pictures').style.display = "none"; // then remove event getElementById('pictures').removeEventListener("mousemove",outPicts); move=0; // reinit the var } } 按预期工作


Angular 17 在开发环境中不接受带点 (.) 的路径,它只会直接抛出 404 错误

导出常量路由:Routes = [ { 路径:'foo.bar',组件:ListComponent }, { 路径:'foobar',组件:ListComponent }, example.com/foobar 运行良好,example.com/foo.bar 返回 40...


React中更新查询参数的解决方案是什么?

更改查询参数时,我在更新产品时遇到问题。例如,我的链接是http://localhost:5173/?page=2,那么useProductQuery钩子将返回第2页的产品(我...


子路径 URL 404 上的 Keycloak 运算符

我正在尝试使用 Operator 将 Keycloak 部署到 kubernetes 集群上。 我需要该应用程序存在于“/auth”而不是“/”上。 我正在使用 ingress-nginx 入口控制器并创建入口...


如何在Jmeter中进行错误处理

我正在使用 Jmeter 对网站进行负载测试。 JMeter 不显示除 404 错误以外的错误。 对于其他情况下发生的错误,如何在 JMeter 中获取错误消息?


Azure SWA - 未找到 Nextjs 图像

我正在尝试在 Azure 的静态 Web 应用程序服务上部署 Next JS 应用程序。我已经构建并运行了应用程序,但图像未渲染。从控制台,它报告 404 not find e...


HTTP错误404:找不到请求资源

我有三个运行在 IIS7 上的系统,静态 IP 地址为 192.168.66.5。我已将系统配置为在具有不同端口和子域名的同一 IP 地址上运行; 192.168.66.5:81 主机名...


如何在 Angular 17 中添加插值而不转义 URL 编码?

我想添加一个routeLink,其中使用Angular插值在字符串中定义完整的URL值,但是当页面执行时,它会转义URL。 预期:http://localhost:4200/books?page=3&sort=...


GoDaddy API 需要域名才能拥有区域文件。如何使用 GoDaddy API 创建区域文件?

我正在使用 GoDaddy API 来注册和配置域名。我多次遇到错误,表明该域没有区域文件。 状态码 404 { “代码”...


获取 Vercel 无服务器函数时出现客户端 404 错误

我用 html、tailwindcss 和 vanilla javascript 创建了一个静态网站。我正在尝试在客户端向 Vercel 的无服务器功能创建一个简单的 POST 请求。我部署了...


Azure openai 语音转文本 -Whisper“代码”:“404”,“消息”:“找不到资源”

我正在尝试通过 Azure openai 密钥、端点、部署使用耳语来转录音频文件 尽管我通过部署在有效区域中进行耳语并使用他们的


从 2.7.17 迁移到 Spring Boot 3.2.1 后出现意外的 404 而不是 400

在我们的项目中,我们使用 Spring Boot 2.7.17、OpenAPI 规范和 RestAssured 进行测试。这是根据我们的规范生成的 API 接口的一部分: @请求映射( 方法 = RequestMethod.GET,...


使用 Okta 登录后台无法正常工作

我正在尝试在后台使用 Okta 设置登录,但当 API 调用点击 Okta 时,我收到错误 404。 我对 okta/backstage 很陌生,但到目前为止我已经按照 Backstage 的文档进行了


找不到 javascript 文件

不知道为什么会收到 404 错误,脚本 index.js 的路径似乎是正确的,因为它与 html 文件位于同一文件夹中。我已经尝试了所有我能想到的方法,不知道哪里出了问题......


Next.js 在生产中禁用服务器功能的缓存

在 next.js 14 中,我有一个页面使用默认的服务器端渲染 (SSR) 来获取一些数据并将其传递到其客户端组件。 导出默认异步函数 Page() { 常量杂志=等待


如何获取选择选项并将它们放入数组中?, playwright + JavaScript

我正在尝试使用 Playwright 从第三个选择 HTML 元素中定位并提取所有选项/文本并将其推送到数组中?我尝试了不同的替代方案,page.locate()、page.$$eval() 和...


如何在 Ruby on Rails 中获取 slug 并将其用作页面的主体类?

我是 Ruby 新手,我有一个项目,我确实需要页面具有唯一的类/ID。这样的话,躺着就非常方便了。 网站上的每个页面都有一个 slug。喜欢 www.site.com/page-


带有 JS 模块模式的 Rails 导入映射错误:“net::ERR_ABORTED 404(未找到)”

我正在使用 Importmap for Rails 7 实现 JavaScript 模块模式,并且遇到与在生产环境中加载自定义帮助程序 JS 文件相关的错误。 我的应用程序/javascript 有一个


找不到页面(404) 请求方式:POST 请求网址:http://127.0.0.1:8000/login/login/

我将用户注册详细信息存储在数据库中,但是当我尝试使用输入的数据登录时,它不起作用;相反,它显示以下消息。 在此输入图像描述


IISNode 对于路由返回 404,但 Node 返回路由

我使用 iisnode 通过 IIS 在 Windows Server 上托管 NodeJS 应用程序。该应用程序具有 Express 路线,当我通过节点(例如 NPM Start)在服务器上启动该应用程序时,它会执行获取路线,而无需...


如何将React项目用于html网站的整个子路由

我有一个现有的 HTML 页面和一个 React 项目。如何连接它们? 首页.html 进入React页面 应用程序.js 我有一个现有的 HTML 页面和一个 React 项目。如何连接它们? home.html <button>go to React page</button> 应用程序.js <BrowserRouter> <Routes> <Route path="/mypage" element={<Mypage />}> </Routes> </BrowserRouter> 我想点击“转到React页面”按钮,我可以导航到"/mypage"? 该按钮应实现对 "/mypage" URL 的导航操作,该 URL 最好为您的 React 应用程序提供服务。 home.html 更新按钮以包含重定向到子路线的点击处理程序 <button onclick="navigateToReactApp()">go to React page</button> const navigateToReactApp = () => { window.location.href = "/mypage"; // check the path correctness }; 或者使用锚标记,这在语义上可能更正确。 <a href="/mypage">go to React page</a> App.js 通过设置 "/mypage" 属性,更新路由器以使所有路由/链接/等从托管/服务应用程序的 basename relative 工作。 <BrowserRouter basename="/mypage"> <Routes> <Route path="/" element={<Mypage />}> </Routes> </BrowserRouter>


我正在使用 laravel livewire 3 获取页面未找到

单击时,我在控制台中找不到页面 错误:POST http://localhost/livewire/update 404(未找到) counter.blade.php {{ $this->count }} 单击时,我在控制台中找不到页面 错误:POST http://localhost/livewire/update 404(未找到) counter.blade.php <div> <h1>{{ $this->count }}</h1> <button wire:click="increment">+</button> <button wire:click="decrement">-</button> </div> 在刀片中我有以下内容: @section('custom-js') @livewireScripts @endsection @section('custom-css') @livewireStyles @endsection <livewire:counter /> 当单击增量或减量时,我找不到页面 如果您使用Livewire3,则无需手动注入livewire资源的css和javascript,因为它们是自动注入的。 检查此文档页面以查看。 您必须先创建 Livewire 组件 php artisan make:livewire CreatePost Livewire 组件的更新功能。 public function update(){...}


为什么 Odoo 17 没有在 <notebook> 中为我的字段渲染标签?

我正在运行有关 Odoo 17 开发的教程,并为第 7 章中的练习创建了以下代码: 我正在运行有关 Odoo 17 开发的教程,并且我为第 7 章中的练习创建了此代码: <record id="estate_view_form" model="ir.ui.view"> <field name="name">estate.property.form</field> <field name="model">estate.property</field> <field name="arch" type="xml"> <form string="Estate Property" create="True"> <sheet> <group string="Info"> <field name="name" /> <field name="description" /> </group> <group string="Location"> <field name="postcode" /> </group> <notebook> <page string="Specs"> <field name="facades" /> <field name="garage" /> </page> </notebook> </sheet> </form> </field> </record> 它可以工作,但 <notebook> 中字段的标签未呈现。我尝试添加 string 属性,但这不起作用。 <notebook> 上的 文档没有提及任何有关此行为的信息。 IIRC 自从我使用的每个版本(6.1+)以来,你必须在 group 周围有一个 field 才能自动获取标签。


将 props 传递给 nextjs 中的页面组件

我正在使用 nextjs 的 withlayout 函数为某些页面添加侧边栏。 导出类型 PageWithLayout = NextPage & { withLayout?:(页面:ReactElement)=> 我正在使用 nextjs 的 withlayout 函数为某些页面添加侧边栏。 export type PageWithLayout<P = {}, IP = P> = NextPage<P, IP> & { withLayout?: (page: ReactElement) => ReactNode; }; 这是我的使用方法: export const Interactions: PageWithLayout = () => { const [ getInteractions, { data: interactionData, fetchMore, variables, loading: isInteractionsLoading, error: isInteractionsError, }, ] = useGetInteractionsLazyQuery({ notifyOnNetworkStatusChange: true, fetchPolicy: "network-only", ssr: false, }); return ( <> <Box height={"100vh"}> </Box> </> ); }; Interactions.withLayout = (page: ReactElement) => { // how do I pass isInteractionsLoading as a prop to this component return <Layout>{page}</Layout>; }; export default Interactions; 我想要实现的是将 isInteractionsLoaded 和 isInteractionsError 作为属性传递给我的布局组件,以便我可以渲染这些状态。有没有一种方法可以实现此目的,而无需将布局组件移动到页面组件内? 创建一个包装组件的 React Context 提供程序可能是您使用的解决方案,如果您不想使用任何其他包或不想使用 redux 等更强大的工具,则可以使用。 但是在这里使用有点尴尬,具体取决于包含交互的组件树是什么样子。否则可以根据您的需要使用 _app 入口点。 示例上下文和用法 import React from 'react'; export const InteractionContext = React.createContext({ isInteractionsLoading: false, isInteractionsError: null, }); // parent component or _app if necessary const ProviderComponent = () => { return ( <InteractionContext.Provider value={{ isInteractionsLoading, isInteractionsError }}> <Interactions /> </InteractionContext.Provider> ); }; const Layout = ({ children }) => { const { isInteractionsLoading, isInteractionsError } = useContext(InteractionContext); // Now you can use isInteractionsLoading and isInteractionsError here // ... return <div>{children}</div>; };


React CSS 导入

在我的 Home.js 中我有以下代码 从“反应”导入反应; 导入'./Home.css'; 常量文本变体 = {...} 常量主页 = () => { 返回 ( ... 在我的 Home.js 中,我有以下代码 import React from 'react'; import './Home.css'; const textVariants = {...} const Home = () => { return ( <div id='home' className='page'> <motion.div className='text-wrapper' variants={textVariants} initial='initial' animate='animate'> <motion.div className='text-container' variants={textVariants}> <motion.h1 variants={textVariants}>NAME</motion.h1> <motion.h2 variants={textVariants}>An enthusiatic university student</motion.h2> </motion.div> </div> ); }; export default Home; 在 Home.css 中, .text-wrapper { max-width: 1366px; height: 100%; } .text-container { height: 100%; width: 50%; padding-left: 10%; h1 { letter-spacing: 10px; font-size: 50px; margin-bottom: -5%; } h2 { font-size: 80px; } } 我有 About.js 和 About.css 以及以下内容, import './About.css'; const About = () => { return ( <div id='about' className='page'> <div className='text-container'> <h1>About Me</h1> </div> </div> ); }; 但是 About.js 应用了 Home.css 中的内容,即 .text-container。我该如何避免这种情况?我不知道为什么 Home.css 被应用到 About.js 即使我没有导入它。 在React js中,任何根组件中导入的css文件适用于整个项目。 css 类可以在项目层次结构中的任何位置访问。 我们无法避免这种情况,因为文件被应用于根目录。您必须为不同的组件使用特定的类名称。 专业提示:创建可重用的组件,以便您可以将相同的类应用于每个相同的组件..


如何从当前打开的 HTML 网站中的元素获取数据?

我发现自己需要深入研究开放网站的 HTML 代码,并从 标签获取一些数据,特别是其中的背景图像元素的值。这个元素改变... 我发现自己需要深入研究开放网站的 HTML 代码,并从 <div> 标签获取一些数据,特别是其中的 background-image 元素的值。该元素会根据页面上执行的操作而发生变化。现在我需要找出如何让我的代码从 Firefox 中打开的选项卡返回该特定元素的值。最简单的方法是什么? 我看了美丽汤,但我不知道还需要搭配什么。据我所知,它对于解析 HTML 数据很有用,但对于首先获取该数据却没有用。 您可以使用 requests 来获取页面的 HTML 内容,如下所示: import requests from bs4 import BeautifulSoup def scrape_website(url): # Send an HTTP request to the URL response = requests.get(url) # Check if the request was successful (status code 200) if response.status_code == 200: # Parse the HTML content of the page soup = BeautifulSoup(response.content, 'html.parser') # Extract data based on HTML structure (replace with your own logic) divs = soup.find_all('div') for div in divs: print(div.text) else: print(f"Failed to retrieve the page. Status code: {response.status_code}") 这里我们向站点发送一个 HTTP 请求,如果响应是 200(等于 ok ),我们将响应中的 HTML 数据发送到变量并使用 Beatiful Soup 解析它。您需要将解析代码更改为最适合您的代码,但此时您可以询问 Chat-GPT。


如何使用 Microsoft Graph API 解决 Sharepoint(FileContentRead) 中的 404 -“ItemNotFound”错误?

我使用下面的 API 使用 Microsoft Graph API 从 Sharepoint 读取其内容。 https://graph.microsoft.com/v1.0/sites/{主机名},{spsite-id},{spweb-id}/drives//items/ 我使用下面的 API 使用 Microsoft Graph API 从 Sharepoint 读取其内容。 https://graph.microsoft.com/v1.0/sites/{hostname},{spsite-id},{spweb-id}/drives/<drive-id>/items/<items-id>/content 两天前,它正确地从根站点正确获取文件内容。但今天我检查了是否获得了与以下问题相同的文件内容。 { "error": { "code": "itemNotFound", "message": "Item not found", "innerError": { "request-id": "<request_id>", "date": "<date_time>" } } } 不知道这可能是什么原因造成的?我在谷歌上搜索没有找到更好的解决方案。 有人建议我解决上述问题的方法。 我建议使用此端点下载流式 DriveItem 内容: GET /sites/{siteId}/drive/items/{item-id}/content https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http


如何使用 blazor <InputDate /> 标签使用当地文化来格式化日期

我正在我的 Blazor 应用程序中使用该标签。但是我如何使用我自己的文化来格式化日期? 我正在我的 Blazor 应用程序中使用该标签。但是我如何使用我自己的文化来格式化日期? <InputDate class="form-control" @bind-Value="@ValidDate" @bind-Value:culture="nl-BE" @bind-Value:format="dd/MM/yyyy" /> 问候 迪特尔 答案是@bind-Value:format,就像这样 @page "/" <EditForm Model="@CurrentPerson"> <InputDate @bind-Value="@CurrentPerson.DateOfBirth" @bind-Value:format="dd/MM/yyyy"/> </EditForm> @code { Person CurrentPerson = new Person(); public class Person { public DateTime DateOfBirth { get; set; } = DateTime.Now; } } 还可以选择使用bind-Value:culture。 无法设置InputDate或<input type="date">的格式。这取决于浏览器设置。用户可以更改浏览器的语言。但您无法从 HTML 更改它。如果您确实需要自定义格式,则必须使用InputText或<input type="text">。我建议使用一些 javascript 库,例如 jQuery UI datepicker。 该解决方案对我不起作用。我是这样工作的: @代码{ 仅私人日期? _geboortedatum; private string GeboortedatumFormatted { get => _geboortedatum?.ToString("dd-MM-yyyy") ?? ""; set { if (DateOnly.TryParse(value, out var newDate)) { _geboortedatum = newDate; } } } } 地质学 _geboortedatum" class="text-danger" />


.NET MAUI、ios UseSafeArea 不工作 StackLayout、VerticalStackLayout 和 Grid

<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Test.Views.Activities.ActivityMapList" xmlns:maps="clr-namespace:Microsoft.Maui.Controls.Maps;assembly=Microsoft.Maui.Controls.Maps" xmlns:sensors="clr-namespace:Microsoft.Maui.Devices.Sensors;assembly=Microsoft.Maui.Essentials" xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls" ios:Page.UseSafeArea="False" Shell.NavBarIsVisible="False" Style="{StaticResource Key=DefaultPage}"> <ContentPage.Content> <StackLayout> <maps:Map VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"> <x:Arguments> <MapSpan> <x:Arguments> <sensors:Location> <x:Arguments> <x:Double>36.9628066</x:Double> <x:Double>-122.0194722</x:Double> </x:Arguments> </sensors:Location> <x:Double>0.01</x:Double> <x:Double>0.01</x:Double> </x:Arguments> </MapSpan> </x:Arguments> </maps:Map> </StackLayout> </ContentPage.Content> </ContentPage> StackLayout 或 Grid 内的地图控件,iOS 的 SafeArea 为 false,如图所示。 你有什么解决办法吗? 我需要在地图上使用网格或堆栈布局 默认情况下.NET MAUI 将考虑安全区域。所以使用特定于平台的UseSafeArea就是禁用安全区域。目前,将 UseSafeArea 设置为 false 不会改变行为(尽管应该如此),这是一个错误。另请参阅 MAUI github 上的问题:https://github.com/dotnet/maui/issues/5856 您还可以设置 IgnoreSafeArea 属性来实现相同的目的。但是,它不再在 .NET 7 中工作,请参阅以下问题:https://github.com/dotnet/maui/issues/12823 要解决您的问题,您需要将 IgnoreSafeArea="True" 添加到您的 Grid 或 StackLayout 并将 ios:Page.UseSafeArea="False" 添加到您的页面。这应该不是必需的,但这是对我有用的解决方法。 有关在 iOS 上禁用安全区域的文档可以在此处找到:https://learn.microsoft.com/en-us/dotnet/maui/ios/platform-specifics/page-safe-area-layout?view=net-毛伊岛-7.0 您可以设置 Page Padding 值来实现。在OnAppearing方法中,设置页面的safeInsets,如下代码: protected override void OnAppearing() { base.OnAppearing(); DeviceSafeInsetsService d = new DeviceSafeInsetsService(); double topArea = d.GetSafeAreaTop(); double bottomArea = d.GetSafeAreaBottom(); var safeInsets = On<iOS>().SafeAreaInsets(); safeInsets.Top = -topArea; safeInsets.Bottom = -bottomArea; Padding = safeInsets; } 要获取 topArea 和 bottomArea 值,您应该编写平台代码。答案末尾附有有关此内容的更详细教程。 首先你可以在Project文件夹中生成一个新的类文件并将其更改为部分类。生成两个部分方法。 public partial class DeviceSafeInsetsService { public partial double GetSafeAreaTop(); public partial double GetSafeAreaBottom(); } 然后在iOS平台生成部分文件并实现。该文件位于 Project/Platform/iOS 文件夹中,我想提一下的是,该文件是一个部分文件,因此命名空间应与上面的文件相同。生成此文件时,请删除命名空间中的 .Platforms.iOS 后缀。 public partial class DeviceSafeInsetsService { public partial double GetSafeAreaBottom() { if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { UIWindow window = UIApplication.SharedApplication.Delegate.GetWindow(); var bottomPadding = window.SafeAreaInsets.Bottom; return bottomPadding; } return 0; } public partial double GetSafeAreaTop() { if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { UIWindow window = UIApplication.SharedApplication.Delegate.GetWindow(); var TopPadding = window.SafeAreaInsets.Top; return TopPadding; } return 0; } } 更多信息,您可以参考如何在.NET MAUI中编写特定于平台的代码和MauiPlatformCode示例代码 希望它对你有用。


© www.soinside.com 2019 - 2024. All rights reserved.