Skip to content

Instantly share code, notes, and snippets.

View loveyunk's full-sized avatar
🌻
Grinding

yw loveyunk

🌻
Grinding
  • 克莱登
  • Beijing, China
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>ONO登录</title>
<style>
.container {
@loveyunk
loveyunk / jsencrypt.html
Last active November 5, 2018 09:44
非对称加密
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
@loveyunk
loveyunk / jwt.js
Last active October 27, 2018 11:57
jsonwebtoken例子
var express = require('express');
var jwt = require('jsonwebtoken');
const app = express();
app.get('/api', function (req, res) {
res.json({
text: 'my api!'
});
});
@loveyunk
loveyunk / request.js
Created July 1, 2018 02:07
request.js
import axios from 'axios';
import config from './config';
const {ERR_OK, BASE_URL_PRO, BASE_URL_DEV} = config;
const baseURL = process.env.NODE_ENV === 'development'
? BASE_URL_DEV
: BASE_URL_PRO;
/**
@loveyunk
loveyunk / upload.html
Created July 1, 2018 02:04
upload.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#custom-button {
padding: 10px;
@loveyunk
loveyunk / eventBus.html
Last active October 27, 2018 12:02
vue global event bus
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Vue Event Bus</title>
</head>
<body>
@loveyunk
loveyunk / pubsub.js
Last active June 2, 2018 07:07
js发布订阅模式
// 发布订阅模式
function PubSub() {
// 收集依赖
this.handlers = {};
}
PubSub.prototype = {
// 订阅事件
on: function (eventType, handler) {
if (!(eventType in this.handlers)) {