V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  fuyun  ›  全部回复第 3 页 / 共 3 页
回复总数  45
1  2  3  
import { isPlatformBrowser } from '@angular/common';
import { Inject, Injectable, PLATFORM_ID } from '@angular/core';

@Injectable({
providedIn: 'root'
})
export class PlatformService {
isBrowser = this.platformId ? isPlatformBrowser(this.platformId) : typeof document === 'object' && !!document;

constructor(@Inject(PLATFORM_ID) private platformId: any) {}
}
调用:
if (!this.platform.isBrowser) {
...
}
另外,机密信息、加密规则建议放在服务端,通过接口去调用。
2023-04-26 00:49:49 +08:00
回复了 rv54ntjwfm3ug8 创建的主题 Angular Angular SSR 多语言的最佳实践(SEO 效果好)是什么?
@duan602728596 我就是使用的 Nest.js + Angular 做的 SSR 网站: https://www.ifuyun.com
GitHub 地址: https://github.com/ifuyun/ifuyun.com
回到题主的问题,多语言是接下来自己也要做的,到时再研究下。
2023-04-22 22:33:33 +08:00
回复了 yuyue001 创建的主题 程序员 ChatGPT 总是 429 怎么解决?“429 Too Many Requests”
[《如何解决 ChatGPT 报 HTTP 429 的问题?》]( https://www.ifuyun.com/post/00lgkis9e5azk7to)
2023-04-22 22:22:13 +08:00
回复了 taolinxs 创建的主题 程序员 请问 大家的个人主页 or 博客 都用的什么程序?
Nest.js + Angular + SSR: https://www.ifuyun.com
2017-02-07 13:51:29 +08:00
回复了 stevenFang 创建的主题 MacBook Pro 2016 Pro 休眠后,屏幕全黑,只能关机
重新盖上屏幕进入休眠,一分钟后打开便恢复登录了。
1  2  3  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1178 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 16ms · UTC 18:17 · PVG 02:17 · LAX 11:17 · JFK 14:17
Developed with CodeLauncher
♥ Do have faith in what you're doing.