增加域名绑定页面展示

dependabot/npm_and_yarn/fir_admin/dns-packet-1.3.4
youngS 4 years ago
parent 3da097f6e5
commit a82f2a3ec7
  1. 98
      fir_client/src/components/FirBase.vue
  2. 2
      fir_client/src/components/user/FirUserProfileInfo.vue
  3. 6
      fir_client/src/main.js
  4. 9
      fir_client/src/store/index.js
  5. 11
      fir_ser/api/views/login.py
  6. 28
      fir_ser/fir_ser/settings.py

@ -1,7 +1,76 @@
<template> <template>
<div ref="appbase"> <div ref="appbase">
<el-dialog
title="绑定域名"
:visible.sync="bind_domain_sure"
width="30%">
<div style="margin: 5px 20px">
<el-steps :active="active" finish-status="success">
<el-step title="步骤 1">
</el-step>
<el-step title="步骤 2">
</el-step>
<el-step title="步骤 3"></el-step>
</el-steps>
<div style="margin-top: 20px">
<div v-if="active===1">
<h2>你的二级域名</h2>
<el-input clearable autofocus v-model="domain_name"></el-input>
</div>
<div v-else-if="active===2">
<h3>还差一步绑定成功</h3>
请联系域名管理员前往 {{ domain_name }} 域名 DNS 管理后台添加如下 CNAME 记录
<el-table
:data="domain_tData"
border
style="width: 100%">
<el-table-column
prop="type"
label="记录类型"
width="100">
</el-table-column>
<el-table-column
prop="host"
label="主机记录"
width="180">
</el-table-column>
<el-table-column
prop="dns"
label="记录值">
</el-table-column>
</el-table>
<el-alert title="请在域名DNS配置成功后,点击“下一步”按钮"
style="margin-top: 30px"
type="warning"
:closable="false"
show-icon/>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button style="margin-top: 12px;" @click="last">上一步</el-button>
<el-button style="margin-top: 12px;" @click="next">下一步</el-button>
</span>
</el-dialog>
<canvas ref="canvas" class="canvas" @mousemove="canvas_move" @mouseleave="canvas_leave"/> <canvas ref="canvas" class="canvas" @mousemove="canvas_move" @mouseleave="canvas_leave"/>
<el-container> <el-container>
<div style="margin: -5px 20px" v-if="$store.state.show_domain_msg">
<el-alert
center
type="error"
:closable="false"
effect="dark">
<div slot="title">
<span :underline="false" class="domian-tip-bar">应用分发请绑定您自己的域名平台域名可能会随时更换将导致您的应用无法访问</span>
<el-button size="medium">立即绑定</el-button>
</div>
</el-alert>
</div>
<el-header> <el-header>
<FirHeader/> <FirHeader/>
</el-header> </el-header>
@ -32,7 +101,11 @@
components: {FirFooter, FirHeader, BackToTop}, components: {FirFooter, FirHeader, BackToTop},
data() { data() {
return { return {
'mousePosition': {}, mousePosition: {},
bind_domain_sure: true,
active: 1,
domain_name: '',
domain_tData: [{'type': 'CNAME', 'host': 'xxx', 'dns': 'sdfsaf'}],
myBackToTopStyle: { myBackToTopStyle: {
right: '80px', right: '80px',
bottom: '100px', bottom: '100px',
@ -47,8 +120,22 @@
mounted() { mounted() {
let canvas = this.$refs.canvas; let canvas = this.$refs.canvas;
show_beautpic(this, canvas, 200); show_beautpic(this, canvas, 200);
}, watch: {} }, watch: {
'$store.state.userinfo.domain_name': function () {
if (this.$store.state.userinfo.domain_name) {
this.$store.dispatch("dodomainshow", false);
} else {
this.$store.dispatch("dodomainshow", true);
}
},
}
, methods: { , methods: {
next() {
if (this.active++ > 2) this.active = 3;
},
last() {
if (this.active-- < 2) this.active = 1;
},
canvas_move(e) { canvas_move(e) {
this.mousePosition.x = e.pageX; this.mousePosition.x = e.pageX;
this.mousePosition.y = e.pageY; this.mousePosition.y = e.pageY;
@ -68,4 +155,11 @@
padding-top: 30px; padding-top: 30px;
} }
.domian-tip-bar {
line-height: 43px;
color: #fff;
font-weight: 500;
font-size: medium;
margin-right: 20px;
}
</style> </style>

@ -254,12 +254,14 @@
saveemail() { saveemail() {
let data = this.authinfo(); let data = this.authinfo();
data.email = this.userinfo.email; data.email = this.userinfo.email;
data.act = 'email';
this.updateUserInfo({"methods": 'PUT', 'data': data}); this.updateUserInfo({"methods": 'PUT', 'data': data});
this.changeemailValue() this.changeemailValue()
}, },
savePhone() { savePhone() {
let data = this.authinfo(); let data = this.authinfo();
data.mobile = this.userinfo.mobile; data.mobile = this.userinfo.mobile;
data.act = 'sms';
this.updateUserInfo({"methods": 'PUT', 'data': data}); this.updateUserInfo({"methods": 'PUT', 'data': data});
this.changePhoneValue() this.changePhoneValue()
}, },

@ -11,6 +11,7 @@ import VueCookies from 'vue-cookies'
//导入store实例 //导入store实例
import store from "@/store"; import store from "@/store";
import { import {
Alert,
Aside, Aside,
Avatar, Avatar,
Backtop, Backtop,
@ -53,6 +54,8 @@ import {
Row, Row,
Select, Select,
Slider, Slider,
Step,
Steps,
Switch, Switch,
Table, Table,
TableColumn, TableColumn,
@ -112,6 +115,9 @@ Vue.use(Slider);
Vue.use(DropdownMenu); Vue.use(DropdownMenu);
Vue.use(Dropdown); Vue.use(Dropdown);
Vue.use(Breadcrumb); Vue.use(Breadcrumb);
Vue.use(Alert);
Vue.use(Step);
Vue.use(Steps);
Vue.use(Input); Vue.use(Input);
Vue.use(CheckboxGroup); Vue.use(CheckboxGroup);
Vue.use(DatePicker); Vue.use(DatePicker);

@ -15,6 +15,7 @@ const store = new Vuex.Store({
currentapp: {}, currentapp: {},
appInfoIndex: [], appInfoIndex: [],
userInfoIndex: 0, userInfoIndex: 0,
show_domain_msg: false,
}, },
mutations: { mutations: {
setuserinfo(state, data) { setuserinfo(state, data) {
@ -28,9 +29,15 @@ const store = new Vuex.Store({
}, },
setcurrentapp(state, val) { setcurrentapp(state, val) {
state.currentapp = val state.currentapp = val
},
setdomainshow(state, val) {
state.show_domain_msg = val
} }
}, },
actions: { actions: {
dodomainshow(context, data) {
context.commit('setdomainshow', data);
},
doUserinfo(context, data) { doUserinfo(context, data) {
context.commit('setuserinfo', data); context.commit('setuserinfo', data);
}, },
@ -47,4 +54,4 @@ const store = new Vuex.Store({
}); });
export default store; export default store;

@ -371,11 +371,12 @@ class UserInfoView(APIView):
mobile = data.get("mobile", None) mobile = data.get("mobile", None)
email = data.get("email", None) email = data.get("email", None)
if mobile or email: if mobile or email:
is_valid = valid_captcha(data.get("cptch_key", None), data.get("authcode", None), request) if CHANGER.get('captcha'):
if not is_valid: is_valid = valid_captcha(data.get("cptch_key", None), data.get("authcode", None), request)
res.code = 1008 if not is_valid:
res.msg = "图片验证码异常" res.code = 1008
return Response(res.dict) res.msg = "图片验证码异常"
return Response(res.dict)
if oldpassword and surepassword: if oldpassword and surepassword:
user = auth.authenticate(username=request.user.username, password=oldpassword) user = auth.authenticate(username=request.user.username, password=oldpassword)

@ -24,7 +24,7 @@ SECRET_KEY = 'j!g@^bc(z(a3*i&kp$_@bgb)bug&^#3=amch!3lz&1x&s6ss6t'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1', 'synchrotron', '172.16.133.34'] ALLOWED_HOSTS = ['127.0.0.1', 'synchrotron', '172.16.133.34','ali.cdn.flyapp.dvcloud.xin','api.src.flyapp.dvcloud.xin']
# Application definition # Application definition
@ -121,13 +121,13 @@ REST_FRAMEWORK = {
'api.utils.throttle.LoginUserThrottle', 'api.utils.throttle.LoginUserThrottle',
], ],
'DEFAULT_THROTTLE_RATES': { 'DEFAULT_THROTTLE_RATES': {
'ShortAccessUser1': '80/m', 'ShortAccessUser1': '180/m',
'ShortAccessUser2': '1000/h', 'ShortAccessUser2': '2000/h',
'LoginUser': '200/m', 'LoginUser': '200/m',
'RegisterUser1': '30/m', 'RegisterUser1': '40/m',
'RegisterUser2': '300/h', 'RegisterUser2': '300/h',
'GetAuthC1': '8/m', 'GetAuthC1': '60/m',
'GetAuthC2': '30/h', 'GetAuthC2': '300/h',
} }
} }
# Internationalization # Internationalization
@ -194,7 +194,7 @@ REGISTER = {
"captcha": False, # 是否开启注册字母验证码 "captcha": False, # 是否开启注册字母验证码
"geetest": True, # 是否开启geetest验证,如要开启请先配置geetest "geetest": True, # 是否开启geetest验证,如要开启请先配置geetest
"register_type": { "register_type": {
'sms': False, # 短信注册 'sms': True, # 短信注册
'email': True, # 邮件注册 'email': True, # 邮件注册
'code': False, # 邀请码注册,邀请码必填写,需要和短信,邮件一起使用 'code': False, # 邀请码注册,邀请码必填写,需要和短信,邮件一起使用
} }
@ -205,7 +205,7 @@ CHANGER = {
"captcha": False, # 是否开启注册字母验证码 "captcha": False, # 是否开启注册字母验证码
"geetest": True, # 是否开启geetest验证,如要开启请先配置geetest "geetest": True, # 是否开启geetest验证,如要开启请先配置geetest
"change_type": { "change_type": {
'sms': False, # 短信注册 'sms': True, # 短信注册
'email': True, # 邮件注册 'email': True, # 邮件注册
'code': False, # 邀请码注册,邀请码必填写,需要和短信,邮件一起使用 'code': False, # 邀请码注册,邀请码必填写,需要和短信,邮件一起使用
} }
@ -214,7 +214,7 @@ LOGIN = {
"captcha": False, # 是否开启登录字母验证码 "captcha": False, # 是否开启登录字母验证码
"geetest": True, # 是否开启geetest验证 "geetest": True, # 是否开启geetest验证
"login_type": { "login_type": {
'sms': False, # 短信登录 'sms': True, # 短信登录
'email': True, # 邮件登录 'email': True, # 邮件登录
'up': True, # 密码登录 'up': True, # 密码登录
} }
@ -279,9 +279,9 @@ THIRD_PART_CONFIG = {
'form': 'FlyApp Validation <flyapps@126.com>', 'form': 'FlyApp Validation <flyapps@126.com>',
'subject': '%(code)s验证', 'subject': '%(code)s验证',
'template_code': { 'template_code': {
'login': '验证码%(code)s,您正在登录,若非本人操作,请勿泄露。', 'login': '欢迎使用FLY 应用分发平台。 您的验证码%(code)s,您正在登录,若非本人操作,请勿泄露。',
'change': '验证码%(code)s,您正在尝试变更重要信息,请妥善保管账户信息。', 'change': '欢迎使用FLY 应用分发平台。 您的验证码%(code)s,您正在尝试变更重要信息,请妥善保管账户信息。',
'register': '验证码%(code)s,您正在注册成为新用户,感谢您的支持!', 'register': '欢迎使用FLY 应用分发平台。 您的验证码%(code)s,您正在注册成为新用户,感谢您的支持!',
} }
}, },
'active': True 'active': True
@ -290,8 +290,8 @@ THIRD_PART_CONFIG = {
'name': 'aliyun', 'name': 'aliyun',
'type': 1, 'type': 1,
'auth': { 'auth': {
'access_key': 'LTAI4FmYZgtCRZcs4j32GUAR', 'access_key': 'LTAI5tJH2EnjVzJGMmNCYo9U',
'secret_key': '7i7J34blLcxTYbwjR9ToK7lEglvJw0', 'secret_key': 'd0LETks5oxkdfbkLGtFihklWGbokab',
'region_id': 'cn-hangzhou', 'region_id': 'cn-hangzhou',
'sing_name': '合合相亲', 'sing_name': '合合相亲',
'template_code': { 'template_code': {

Loading…
Cancel
Save