Git Product home page Git Product logo

liyupi / code-nav Goto Github PK

View Code? Open in Web Editor NEW
2.5K 39.0 543.0 94.17 MB

💎 专业的编程导航,帮你找到优质的编程学习资源!公众号【编程导航】 ☁️ 前后端均开源,励志成为最好的全栈云开发项目!

Home Page: https://www.code-nav.cn

License: MIT License

JavaScript 83.36% Dockerfile 0.01% TypeScript 8.15% Less 0.50% HTML 6.38% CSS 0.67% Java 0.72% EJS 0.21%
code resources guide java python cpp javascript frontend backend algorithm nav golang csharp cloudbase full-stack programming-learning

code-nav's Issues

再加一种主题

主页的透明主题和白底太少了,应该再加一个亚克力的

Issue: Bug report 🐞

Bug report 🐞

编程导航 个人中心部分 点击编辑 弹出的修改信息对话框 输入邮箱 在没有输入完的时候就做了邮箱验证 我觉得这样是不符合交互预期的。

Expection

期望在用户脱离光标的时候在做验证

是否能通过PWA+P2P防御攻击

  • index.html/chunk.js/main.js 使用service worker 在用户客户端做持久化缓存
  const cacheName = "ashes";
  const cacheFiles = ["index.html", "webtorrent.min.js", "test.css", "register.js"];
  self.addEventListener("install", (e) => {
    console.log("[Service Worker] Install");
    e.waitUntil(
      (async () => {
        const keys = await caches.keys();
        console.log(keys);
        if (keys.includes(cacheName)) {
          return;
        }
        const cache = await caches.open(cacheName);
        console.log("[Service Worker] Caching all: app shell and content");
        await cache.addAll(cacheFiles);
      })()
    );
  • 热点数据缓存:

    • 首页数据使用
      window.addEventListener("fetch", async (data)=>{
        //cache name 定期更新,用来进行首页数据更新
      		const cache = await caches.open(cacheName);
      		await cache.addAll(cacheFiles);
      })
  • 核心数据接口使用webtorrent生成磁链

const sourceFiles = new blob(JSON.stringify(dataObj))

export const createTorrent = async (sourceFiles) => {
	const isMultiFiles = sourceFiles.length > 1;
	const listItem = await new Promise<CustomStruct>((res, rej) => {
		client.seed(
			sourceFiles,
			{
        //辅助打洞服务
				announce: ["udp://ip:port", "ws://ip:port", "http://ip:port", "http://ip:port/announce"],
			},
			(torrent) => {
				const { files, magnetURI, name, infoHash, torrentFileBlobURL } = torrent;
				const type = isMultiFiles ? "hybrid" : sourceFiles[0].type;
				const names = isMultiFiles ? files.map(({ name }) => name).join(" | ") : name;
				res({
					name: names,
					magnetURI,
					id: infoHash,
					fileUrl: torrentFileBlobURL,
					lastModified: Date.now(),
					type,
				});
			}
		);
		client.on("error", (err) => rej(err));
	});
	return listItem;
};
  • 协议层/server配置
    udp/tcp协议访问时,发送磁链,如磁链未建立新的peer,则判定为无意义访问,加入封禁列表

  • Q&A
    为什么使用磁链:使用网站的人越多,数据访问的速度越快
    为什么需要辅助打洞:解决多层NAT导致的无法访问/丢包问题
    如何迁移现有项目:

  • 使用nginx转发现有服务,让现有用户逐步成为P2P的节点,提供基础访问速度

  • 页面端使用现有的npm包,可以让项目自带service worker

打包失败

利用 npm run build 时,一直卡在 95%

提示为 OptimizeCssAssetsWebpackPlugin

推荐后无法自行修改推荐内容

能否提供修改功能并且修改后内容需要重新审核,应用场景如更换域名更换资源等,无法及时更新,或错误操作导致内容无法正常处理

无法登录

公众号获取验证码后,一直转圈,在控制台看,报错显示失败
image
image

样式问题

未登录状态

头像位置出现提示

导致出现了横向滚动条

image

心愿墙显示问题

image

截图中右边还有充足空间,第三个卡片显示每行只显示 4 个字,阅读体验不佳。

优化建议:资源大全下,点击标签

优化建议:资源大全下,点击标签切换时,应该设置一个多个筛选条件还是单个筛选条件。默认应该为单个筛选条件,都比较喜欢点一下就换一个筛选标签,而不是默认多个筛选条件叠加

关于登陆

如何设置某个页面可以不用登陆访问呢
我添加 authority:{['admin', 'user', 'guest']} 没有效果

mock数据应该如何运行呢?

我在vscode中通过npm run start把编程导航主站的项目运行起来了,
image
点用户登录没有反应,现在想添加mock里的数据试试,在config/config.ts中把"mock: false,"这句去掉之后就报错了
ZSXQ_20220217_232811032
报错信息:“mock value of MOCK_OPEN should be function or object, but got boolean”
应该是要怎么才能使用mock里的数据呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.