Commit f22ae4f9 by 庄欣

init

parent c1adec61
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
.cicon {
position: fixed;
right:20px;
bottom: 20px;
background-color: #fffccc;
border-radius: 30px;
width: 50px;
height: 50px;
border: 1px solid #ff8528;
display: flex;
text-align: center;
justify-items: center;
justify-content: center;
align-items: center;
align-content: center;
}
.x {
width: 30px;
height: 30px;
background-color: white;
color: #666600;
display: flex;
border-radius: 15px;
justify-content: center;
align-items: center;
align-content: center;
justify-items: center;
position: absolute;
right: -12px;
top: -12px;
}
.cicon img {
height: 40px;
width: 40px;
}
#___container {
background-color: #FFFF99;
width: 30%;
text-align: center;
position: fixed;
left: 35%;
top: 70px;
z-index: 999;
font-size: 14px;
color: #666600;
padding-bottom: 30px;
padding-top:20px;
}
.userinfo {
margin-top:10px;
}
.userinfo .form-group {
display: flex;
align-content: center;
align-items: center;
width: 100%;
}
.userinfo .form-group .label{
width: 20%;
text-align: right;
}
.userinfo .form-group .input{
width: 80%;
}
.userinfo .form-group .input input{
width: 90%;
}
input[type=radio] {
background-color: #fffccc;
-webkit-appearance:checkbox!important;
height: 15px;
width: 15px;
}
.id-flex {
display:flex;
justify-content: center;
width: 100%;
align-content: center;
align-items: center;
}
#___container a {
text-decoration: underline;
}
#___container div.danger {
display: flex;
align-content: center;
align-items: center;
text-align: center;
color: #ff0000;
justify-content: center;
}
#___container div.primary {
display: flex;
align-content: center;
align-items: center;
text-align: center;
color: #0277bd;
justify-content: center;
}
#___container button.primary {
display: flex;
align-content: center;
align-items: center;
text-align: center;
padding: 5px 10px 5px 10px;
background-color: #0277bd;
color: white;
border-radius: 5px;
}
#___container button.danger {
display: flex;
align-content: center;
align-items: center;
text-align: center;
padding: 5px 10px 5px 10px;
background-color: #ff0000;
color: white;
border-radius: 5px;
}
.zone {
display: flex;
justify-content: center;
align-content: center;
}
#___container .mask {
position: absolute;
width: 100%;
height: 100%;
z-index: 999;
top: 0;
background-color: rgba(0,0,0,0.2);
display:flex;
justify-content: center;
align-items: center;
align-content: center;
justify-items: center;
color: #ffffff;
}
.xuanzhuan {
animation: xz 1s linear infinite;
}
@keyframes xz {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.__messagebox_container {
width: 100%;
margin: 0 auto;
position: absolute;
z-index: 999;
background-color: rgb(255, 255, 153);
}
._button_groups {
flex-direction: row;
margin: 10px auto;
display: flex;
justify-content: space-between;
width: 70%;
}
.btn {
width: auto;
padding-left: 20px;
padding-right: 20px;
background: #0277bd;
border: none;
height: 30px;
color: white;
border-radius: 2px;
}
.pushContent {
margin: 0 auto;
width: 90%;
text-align: left;
}
.activeCls {
background-color: #FF9F2A!important;
color: #FFFF99!important;
}
.upload {
height: 100px;
display: flex;
justify-content: left;
align-content: center;
align-items: center;
padding-left: 30px;
}
.info {
display: flex;
justify-self: left;
padding-left: 20px;
color: #0277bd;
}
.btn-default {
background-color: #ffffff;
color: #333333;
width: auto;
padding-left: 20px;
padding-right: 20px;
border: none;
height: 30px;
border-radius: 2px;
}
\ No newline at end of file
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
chrome.cookies.get({
url: "https://www.mepai.me/",
name: "auth"
}, cookie => {
if (cookie === undefined || cookie === null || cookie === "") {
sendResponse({access_token: ""});
} else {
sendResponse({access_token: cookie.value});
}
});
});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"manifest_version": 2,
"name": "mepai-user-remark",
"description": "米拍用户备注小工具",
"version": "1.0",
"permissions": [
"tabs",
"webRequest",
"cookies",
"*://*.mepai.me/"
],
"background": {
"scripts": ["/js/background.js"]
},
"content_scripts": [
{
"matches": ["https://www.mepai.me/*"],
"css": ["/css/main.css"],
"js": ["/js/vue.js", "/js/jquery.min.js", "/js/index.js"],
"run_at": "document_end"
}
],
"web_accessible_resources": [
"ui.html", "icon.png","close.png","loading.png"
],
"browser_action": {
"default_icon": "icon.png",
"default_title": "米拍用户备注小工具"
}
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
width:100px;
height:100px;
}
#container {
display: flex;
align-items: center;
align-content: center;
justify-items: center;
justify-content: center;
}
#container button {
background-color: #FF9F2A;
font-size: 18px;
color: white;
margin-top: 20px;
}
</style>
</head>
<body>
</body>
</html>
\ No newline at end of file
<div v-if="showUiProp" id="___container">
<div class="mask" v-if="loading">
<img class="xuanzhuan" :src="loadingimg" style="width:10%;"></img>
</div>
<div class="x" v-on:click="showUi"><img :src="closeX"></div>
<div class="danger" v-if="err != ''">{{err}}</div>
<div class="info" v-if="info.length > 0" v-for="m,index in info">{{m}}</div>
<!------------------- 用户开始 -------->
<div class="userinfo row" v-if="isUserInfo && canOpen && isAuth && !sendPush">
<div class="col-md-12">
<div class="form-group">
<div class="label">用户id:</div>
<div class="input"><input class="form-control" :value="user.id" disabled/></div>
</div>
<div class="form-group">
<div class="label">用户昵称:</div>
<div class="input"><input class="form-control" :value="user.nickname" disabled/></div>
</div>
<div class="form-group">
<div class="label">手机:</div>
<div class="input"><input class="form-control" :value="user.mobile" disabled /></div>
</div>
<div class="form-group">
<div class="label">微信:</div>
<div class="input"><input class="form-control" :value="user.wx" disabled /></div>
</div>
<div class="form-group">
<div class="label">QQ:</div>
<div class="input"><input class="form-control" :value="user.qq" disabled /></div>
</div>
<div class="form-group">
<div class="label">邮箱:</div>
<div class="input"><input class="form-control" :value="user.email" disabled /></div>
</div>
<div class="id-flex" style="margin-top: 10px;">
<div class="">用户内容是否可被有米计划使用</div>
<div class="">
<input type="radio" name="userPermission" value="-1" v-model="userPermission"/> 未设置
<input type="radio" name="userPermission" value="0" v-model="userPermission"/> 不可用
<input type="radio" name="userPermission" value="1" v-model="userPermission"/> 可用
</div>
</div>
<div class="form-group" style="display: block!important;">
<div class=""><label>备注该用户:</label></div>
<div class="">
<textarea
class="form-control"
placeholder="备注内容"
v-model="userRemark"
rows="5"
cols="50"
></textarea>
</div>
</div>
<div style="display: flex;justify-content: center;justify-items: center">
<button class="btn btn-primary primary large" v-on:click="submitUserRemark">提交用户设置</button>
</div>
</div>
</div>
<!------------------- 用户结束 作品开始 -------->
<div class="workinfo row" v-if="isWorks && canOpen && isAuth && !sendPush" style="margin-top:20px;">
<div class="col-md-12">
<div class="id-flex">
<div>作品id:{{objectId}}</div>
<div v-if="isYoumi == 1" class="primary">(此作品已参加有米计划,参与时间:{{youmiCreateTime}})</div>
<div v-if="isYoumi == 0" class="danger">(此作品未参加有米计划)</div>
</div>
<div class="id-flex">
<div class="label">推荐作品到<a href="https://www.mepai.me/mp/secret/youmibeixuan" target="_blank">编辑备选库</a>:</div>
<div v-if="inZone === false" class="form-group zone">
<button class="btn btn-primary primary small" v-on:click="addZone">+推荐入库</button>
</div>
<div v-if="inZone === true" class="form-group zone">
<button class="btn btn-danger danger small" v-on:click="removeZone">-已推入,点击移除</button>
</div>
</div>
<div class="id-flex">
<div class="label">该作品是否可被有米计划使用:</div>
<div class="input">
<input type="radio" name="permission" value="-1" v-model="permission"/> 未设置
<input type="radio" name="permission" value="0" v-model="permission"/> 不可用
<input type="radio" name="permission" value="1" v-model="permission"/> 可用
</div>
</div>
<div class="form-group">
<div class="label"><label>备注该作品:</label></div>
<div class="input">
<textarea class="form-control" rows="5" cols="50"
placeholder="备注内容"
name="remark" v-model="remark">
</textarea>
</div>
</div>
<div class="form-group" style="display: flex;justify-items: center;justify-content: center">
<button class="btn btn-primary primary large" v-on:click="submitRemark">提交作品设置</button>
</div>
</div>
</div>
<!------------------- 作品结束 文章开始 -------->
<div class="readinginfo row" v-if="isReading && canOpen && isAuth && !sendPush" style="margin-top:20px">
<div class="col-md-12">
<div class="id-flex">
<div>文章id:{{objectId}}</div>
<div v-if="isYoumi == 1" class="primary">(此文章已参加有米计划,参与时间:{{youmiCreateTime}}) </div>
<div v-if="isYoumi == 0" class="danger">(此文章未参加有米计划)</div>
</div>
<!--<div v-if="inZone === false" class="form-group zone">
<div class="label">此文章未在有米计划备选公共库:</div>
<div class="input">
<button class="btn btn-primary primary small" v-on:click="addZone">+添加</button>
</div>
</div>
<div v-if="inZone === true" class="form-group zone">
<div class="label">此文章已在有米计划备选公共库:</div>
<div class="input">
<button class="btn btn-danger danger small" v-on:click="removeZone">-移除</button>
</div>
</div>-->
<div class="id-flex">
<div class="label">该文章是否可被有米计划使用</div>
<div class="input">
<input type="radio" name="permission" value="-1" v-model="permission"/> 未设置
<input type="radio" name="permission" value="0" v-model="permission"/> 不可用
<input type="radio" name="permission" value="1" v-model="permission"/> 可用
</div>
</div>
<div class="form-group">
<div class="label"> <label>备注该文章:</label></div>
<div class="input">
<textarea class="form-control" rows="5" cols="50" placeholder="备注内容" name="remark" v-model="remark"></textarea>
</div>
</div>
<div class="form-group" style="display: flex;justify-items: center;justify-content: center">
<button class="btn btn-primary primary large" v-on:click="submitRemark">提交文章设置</button>
</div>
</div>
</div>
<!------------------- 文章结束 -------->
<!------------------- 消息推送 ---------------->
<div class="form-group" style="margin: 30px auto;display: flex;justify-content: center"
v-if="(authType == 'auth' || authType =='pic' | authType=='now') && canOpen && isAuth && !sendPush"
>
<button class="btn button-primary primary large" v-on:click="openMessageBox">给作者发送消息</button>
</div>
<div class="__messagebox_container" v-if="sendPush">
<label>站内Push内容(可修改)</label>
<div class="_button_groups">
<button class="btn-default" :class="authType=='auth' ? 'activeCls' : ''" v-on:click="changeTab('auth')">要授权</button>
<button class="btn-default" :class="authType=='pic' ? 'activeCls' : ''" v-show="isWorks" v-on:click="changeTab('pic')">要大图</button>
<button class="btn-default" :class="authType=='now' ? 'activeCls' : ''" v-show="!isWorks" v-on:click="changeTab('now')">要大图</button>
</div>
<div class="auth">
<textarea cols="50" rows="7" class="pushContent" name="pushContentAuth" v-show="authType=='auth'" v-model="authContent"></textarea>
<textarea cols="50" rows="7" class="pushContent" name="pushContentPic" v-show="authType=='pic'" v-model="picContent"></textarea>
<textarea cols="50" rows="7" class="pushContent" name="pushContentN" v-show="authType=='now'" v-model="pushContentN"></textarea>
</div>
<!-- <div class="upload">
<input type="file" name="uploadFile"/>
</div>-->
<label>短信内容(不可修改)</label>
<div class="auth">
<textarea cols="50" rows="5" class="pushSmsContent" readonly>{{smsContent}}</textarea>
</div>
<div class="">
<div class="_button_groups">
<div>
<button class="btn" v-on:click="sendPushOnly">仅发送米拍站内PUSH</button>
</div>
<div>
<button class="btn" v-on:click="sendAll">发送PUSH和短信</button>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
local headers = ngx.req.get_headers();
local ip = headers["X-REAL-IP"] or headers["X_FORWARDED_FOR"] or ngx.var.remote_addr or "0.0.0.0"
local key = "__bind_" .. ip
local redis = require "resty.redis"
local redisClient = redis:new()
local ok, err = redisClient:connect("127.0.0.1", 6379)
if not ok then
ngx.say('{"code":"100500","message":"发送失败,redis不可读","data":[]}');
ngx.exit(0)
end
-- redisClient:auth("password")
local count, err = redisClient:get(key)
if count ~= ngx.null then
redisClient:close()
ngx.exit(401)
end
\ No newline at end of file
......@@ -21,6 +21,27 @@ http {
local headers = ngx.req.get_headers();
local version = headers["app-version"];
local device = headers["app-device"];
local ip = headers["X-REAL-IP"] or headers["X_FORWARDED_FOR"] or ngx.var.remote_addr or "0.0.0.0"
if ip ~= "0.0.0.0" then
local key = "__bind_" .. ip
local key2 = "__count_ip_" .. ip
local redis = require "resty.redis"
local redisClient = redis:new()
local ok, err = redisClient:connect("127.0.0.1", 6379)
-- redisClient:auth("password")
local count, err = redisClient:incr(key2)
if count == 1 then
local r,e = redisClient:expire(key2, 120)
end
if count > 5 then
ngx.say('{"code":"100500","message":"发送失败,休息一下吧","data":[]}');
redisClient:set(key, 1);
redisClient:expire(key, 60);
return ngx.exit(0)
end
end
if version == nil or device == nil then
ngx.say('{"code":"100500","message":"发送失败","data":[]}');
......
debug: 1
debug: 0
dev:
db: root:mH9TaSz#FV43T*z%@(111.231.204.74:3306)/mepai_v2
qcloud:
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -126,6 +126,9 @@ func Begin() {
func updateUser(users []FUser) error{
for _,u := range users {
if u.Uid <= 0 {
return errors.New(fmt.Sprintf("错误的数据:uid = %d", u.Uid))
}
info, nook := getOne(u.Uid);
if nook != nil {
return nook
......
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment