修改部分样式问题,新增解析转义,修改buyer端没有第三方登录问题

master
lemon橪 2021-09-09 10:43:41 +08:00
parent aaadc90b09
commit 8c864c207a
9 changed files with 215 additions and 177 deletions

View File

@ -3,10 +3,7 @@
<!-- 顶部logo -->
<div class="top-content" @click='$refs.verify.show = false'>
<div class="logo-box">
<img
:src="$store.state.logoImg"
@click="$router.push('/')"
/>
<img :src="$store.state.logoImg" @click="$router.push('/')" />
<div>欢迎登录</div>
</div>
</div>
@ -16,9 +13,7 @@
<Carousel loop :autoplay-speed="5000" class="login-carousel" arrow="never">
<CarouselItem>
<div class="demo-carousel" @click='$refs.verify.show = false'>
<img
src="https://wanmi-b2b.oss-cn-shanghai.aliyuncs.com/201811141632252680"
/>
<img src="https://wanmi-b2b.oss-cn-shanghai.aliyuncs.com/201811141632252680" />
</div>
</CarouselItem>
</Carousel>
@ -32,99 +27,65 @@
<div @click="$router.push('signUp')"></div>
</div>
<!-- 账号密码登录 -->
<Form
ref="formInline"
:model="formData"
:rules="ruleInline"
v-show="type === true"
@click.self='$refs.verify.show = false'
>
<Form ref="formInline" :model="formData" :rules="ruleInline" v-show="type === true"
@click.self='$refs.verify.show = false'>
<FormItem prop="username">
<i-input
type="text"
v-model="formData.username"
clearable
placeholder="用户名"
>
<i-input type="text" v-model="formData.username" clearable placeholder="用户名">
<Icon type="md-person" slot="prepend"></Icon>
</i-input>
</FormItem>
<FormItem prop="password">
<i-input
type="password"
v-model="formData.password"
clearable
placeholder="密码"
>
<i-input type="password" v-model="formData.password" clearable placeholder="密码">
<Icon type="md-lock" slot="prepend"> </Icon>
</i-input>
</FormItem>
<FormItem>
<Button
type="error"
@click.stop="handleSubmit('formInline')"
long
>登录</Button>
<Button type="error" @click.stop="handleSubmit('formInline')" long>登录</Button>
</FormItem>
</Form>
<!-- 验证码登录 -->
<Form
ref="formSms"
:model="formSms"
:rules="ruleInline"
v-show="type === false"
@click.self='$refs.verify.show = false'
>
<Form ref="formSms" :model="formSms" :rules="ruleInline" v-show="type === false"
@click.self='$refs.verify.show = false'>
<FormItem prop="mobile">
<i-input
type="text"
v-model="formSms.mobile"
clearable
placeholder="手机号"
>
<i-input type="text" v-model="formSms.mobile" clearable placeholder="手机号">
<Icon type="md-lock" slot="prepend"></Icon>
</i-input>
</FormItem>
<FormItem prop="code">
<i-input
type="text"
v-model="formSms.code"
placeholder="手机验证码"
>
<Icon
type="ios-text-outline"
style="font-weight: bold"
slot="prepend"
/>
<i-input type="text" v-model="formSms.code" placeholder="手机验证码">
<Icon type="ios-text-outline" style="font-weight: bold" slot="prepend" />
<Button slot="append" @click="sendCode">{{ codeMsg }}</Button>
</i-input>
</FormItem>
<FormItem>
<Button @click.stop="verifyBtnClick" long :type="verifyStatus?'success':'default'">{{verifyStatus?'验证通过':'点击完成安全验证'}}</Button>
<Button @click.stop="verifyBtnClick" long
:type="verifyStatus?'success':'default'">{{verifyStatus?'验证通过':'点击完成安全验证'}}</Button>
</FormItem>
<FormItem>
<Button
type="error"
@click="handleSubmit('formSms')"
long
>登录</Button>
<Button type="error" @click="handleSubmit('formSms')" long>登录</Button>
</FormItem>
</Form>
<div class="regist">
<span @click="$router.push('forgetPassword')"></span>
</div>
<div class="other-login">
<Icon custom="icomoon icon-qq" color="" class="icon-hover" @click="handleWebLogin('QQ')"/>
<Icon custom="icomoon icon-wechat" color="" class="icon-hover" @click="handleWebLogin('WECHAT_PC')"/>
<svg t="1631154795933" class="icon" @click="handleWebLogin('QQ')" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="4969" width="32" height="32">
<path
d="M824.8 613.2c-16-51.4-34.4-94.6-62.7-165.3C766.5 262.2 689.3 112 511.5 112 331.7 112 256.2 265.2 261 447.9c-28.4 70.8-46.7 113.7-62.7 165.3-34 109.5-23 154.8-14.6 155.8 18 2.2 70.1-82.4 70.1-82.4 0 49 25.2 112.9 79.8 159-26.4 8.1-85.7 29.9-71.6 53.8 11.4 19.3 196.2 12.3 249.5 6.3 53.3 6 238.1 13 249.5-6.3 14.1-23.8-45.3-45.7-71.6-53.8 54.6-46.2 79.8-110.1 79.8-159 0 0 52.1 84.6 70.1 82.4 8.5-1.1 19.5-46.4-14.5-155.8z"
p-id="4970" fill="#1296db"></path>
</svg>
<svg t="1631154766336" class="icon" @click="handleWebLogin('WECHAT_PC')" viewBox="0 0 1024 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg" p-id="3844" width="32" height="32">
<path
d="M683.058 364.695c11 0 22 1.016 32.943 1.976C686.564 230.064 538.896 128 370.681 128c-188.104 0.66-342.237 127.793-342.237 289.226 0 93.068 51.379 169.827 136.725 229.256L130.72 748.43l119.796-59.368c42.918 8.395 77.37 16.79 119.742 16.79 11 0 21.46-0.48 31.914-1.442a259.168 259.168 0 0 1-10.455-71.358c0.485-148.002 128.744-268.297 291.403-268.297l-0.06-0.06z m-184.113-91.992c25.99 0 42.913 16.79 42.913 42.575 0 25.188-16.923 42.579-42.913 42.579-25.45 0-51.38-16.85-51.38-42.58 0-25.784 25.93-42.574 51.38-42.574z m-239.544 85.154c-25.384 0-51.374-16.85-51.374-42.58 0-25.784 25.99-42.574 51.374-42.574 25.45 0 42.918 16.79 42.918 42.575 0 25.188-16.924 42.579-42.918 42.579z m736.155 271.655c0-135.647-136.725-246.527-290.983-246.527-162.655 0-290.918 110.88-290.918 246.527 0 136.128 128.263 246.587 290.918 246.587 33.972 0 68.423-8.395 102.818-16.85l93.809 50.973-25.93-84.677c68.907-51.93 120.286-119.815 120.286-196.033z m-385.275-42.58c-16.923 0-34.452-16.79-34.452-34.179 0-16.79 17.529-34.18 34.452-34.18 25.99 0 42.918 16.85 42.918 34.18 0 17.39-16.928 34.18-42.918 34.18z m188.165 0c-16.984 0-33.972-16.79-33.972-34.179 0-16.79 16.927-34.18 33.972-34.18 25.93 0 42.913 16.85 42.913 34.18 0 17.39-16.983 34.18-42.913 34.18z"
fill="#09BB07" p-id="3845"></path>
</svg>
</div>
</div>
<!-- 拼图验证码 -->
<verify
ref="verify"
class="verify-con"
verifyType="LOGIN"
@change="verifyChange"
></verify>
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
</div>
<div class="foot">
<Row type="flex" justify="space-around" class="help">
@ -142,52 +103,53 @@
</template>
<script>
import * as RegExp from '@/plugins/RegExp.js';
import { md5 } from '@/plugins/md5.js';
import * as apiLogin from '@/api/login.js';
import { sendSms } from '@/api/common.js';
import { webLogin, loginCallback } from '@/api/login.js';
import storage from '@/plugins/storage.js';
import verify from '@/components/verify';
import * as RegExp from "@/plugins/RegExp.js";
import { md5 } from "@/plugins/md5.js";
import * as apiLogin from "@/api/login.js";
import { sendSms } from "@/api/common.js";
import { webLogin, loginCallback } from "@/api/login.js";
import storage from "@/plugins/storage.js";
import verify from "@/components/verify";
export default {
name: 'Login',
name: "Login",
components: {
verify
verify,
},
data() {
return {
type: true, // true false
formData: {
//
username: '',
password: ''
username: "",
password: "",
},
formSms: { //
code: '',
mobile: ''
formSms: {
//
code: "",
mobile: "",
},
verifyStatus: false, //
ruleInline: {
//
username: [{ required: true, message: '请输入用户名' }],
username: [{ required: true, message: "请输入用户名" }],
password: [
{ required: true, message: '请输入密码' },
{ type: 'string', min: 6, message: '密码不能少于6位' }
{ required: true, message: "请输入密码" },
{ type: "string", min: 6, message: "密码不能少于6位" },
],
mobile: [
{ required: true, message: '请输入手机号码' },
{ required: true, message: "请输入手机号码" },
{
pattern: RegExp.mobile,
message: '请输入正确的手机号'
}
],
code: [{ required: true, message: '请输入手机验证码' }]
message: "请输入正确的手机号",
},
codeMsg: '发送验证码', //
],
code: [{ required: true, message: "请输入手机验证码" }],
},
codeMsg: "发送验证码", //
interval: null, //
time: 60, //
year: new Date().getFullYear()
year: new Date().getFullYear(),
};
},
methods: {
@ -202,17 +164,20 @@ export default {
apiLogin.smsLogin(data).then((res) => {
this.$refs.verify.show = false;
if (res.success) {
this.$Message.success('登录成功');
storage.setItem('accessToken', res.result.accessToken);
storage.setItem('refreshToken', res.result.refreshToken);
this.$Message.success("登录成功");
storage.setItem("accessToken", res.result.accessToken);
storage.setItem("refreshToken", res.result.refreshToken);
apiLogin.getMemberMsg().then((res) => {
if (res.success) {
storage.setItem('userInfo', res.result);
storage.setItem("userInfo", res.result);
let query = this.$route.query;
if (query.rePath) {
this.$router.push({path: query.rePath, query: JSON.parse(query.query)});
this.$router.push({
path: query.rePath,
query: JSON.parse(query.query),
});
} else {
this.$router.push('/');
this.$router.push("/");
}
}
});
@ -227,27 +192,27 @@ export default {
//
sendCode() {
if (this.time === 60) {
if (this.formSms.mobile === '') {
this.$Message.warning('请先填写手机号');
if (this.formSms.mobile === "") {
this.$Message.warning("请先填写手机号");
return;
}
if (!this.verifyStatus) {
this.$Message.warning('请先完成安全验证');
this.$Message.warning("请先完成安全验证");
return;
}
let params = {
mobile: this.formSms.mobile,
verificationEnums: 'LOGIN'
verificationEnums: "LOGIN",
};
sendSms(params).then(res => {
sendSms(params).then((res) => {
if (res.success) {
this.$Message.success('验证码发送成功');
this.$Message.success("验证码发送成功");
let that = this;
this.interval = setInterval(() => {
that.time--;
if (that.time === 0) {
that.time = 60;
that.codeMsg = '重新发送';
that.codeMsg = "重新发送";
that.verifyStatus = false;
clearInterval(that.interval);
} else {
@ -260,28 +225,35 @@ export default {
});
}
},
verifyChange (con) { //
verifyChange(con) {
//
if (!con.status) return;
if (this.type === true) { //
if (this.type === true) {
//
let data = JSON.parse(JSON.stringify(this.formData));
data.password = md5(data.password);
this.$refs.verify.show = false;
this.$Spin.show();
apiLogin.login(data).then((res) => {
apiLogin
.login(data)
.then((res) => {
if (res.success) {
this.$Message.success('登录成功');
storage.setItem('accessToken', res.result.accessToken);
storage.setItem('refreshToken', res.result.refreshToken);
this.$Message.success("登录成功");
storage.setItem("accessToken", res.result.accessToken);
storage.setItem("refreshToken", res.result.refreshToken);
apiLogin.getMemberMsg().then((res) => {
this.$Spin.hide();
if (res.success) {
storage.setItem('userInfo', res.result);
storage.setItem("userInfo", res.result);
let query = this.$route.query;
if (query.rePath) {
this.$router.push({path: query.rePath, query: JSON.parse(query.query)});
this.$router.push({
path: query.rePath,
query: JSON.parse(query.query),
});
} else {
this.$router.push('/');
this.$router.push("/");
}
}
});
@ -289,8 +261,9 @@ export default {
this.$Spin.hide();
this.$Message.error(res.message);
}
}).catch(() => {
this.$Spin.hide()
})
.catch(() => {
this.$Spin.hide();
});
} else {
this.verifyStatus = true;
@ -303,27 +276,31 @@ export default {
this.$refs.verify.init();
}
},
handleWebLogin (type) { //
handleWebLogin(type) {
//
webLogin(type);
}
},
},
mounted() {
let uuid = this.$route.query.state;
if (uuid) {
storage.setItem('uuid', uuid);
loginCallback(uuid).then(res => {
storage.setItem("uuid", uuid);
loginCallback(uuid).then((res) => {
if (res.success) {
const result = res.result;
storage.setItem('accessToken', result.accessToken);
storage.setItem('refreshToken', result.refreshToken);
storage.setItem("accessToken", result.accessToken);
storage.setItem("refreshToken", result.refreshToken);
apiLogin.getMemberMsg().then((res) => {
if (res.success) {
storage.setItem('userInfo', res.result);
storage.setItem("userInfo", res.result);
let query = this.$route.query;
if (query.rePath) {
this.$router.push({path: query.rePath, query: JSON.parse(query.query)});
this.$router.push({
path: query.rePath,
query: JSON.parse(query.query),
});
} else {
this.$router.push('/');
this.$router.push("/");
}
}
});
@ -341,10 +318,10 @@ export default {
this.verifyStatus = false;
this.$refs.verify.show = false;
clearInterval(this.interval);
this.codeMsg = '发送验证码';
this.codeMsg = "发送验证码";
this.time = 60;
}
}
},
},
};
</script>
<style scoped lang="scss">
@ -402,7 +379,7 @@ export default {
top: 80px;
right: 15%;
padding: 20px;
background:rgba(255,255,255,.8);
background: rgba(255, 255, 255, 0.8);
.account-number {
display: flex;
justify-content: space-between;
@ -442,8 +419,11 @@ export default {
.other-login {
margin: 0 auto;
.ivu-icon {
font-size: 24px;
> svg {
cursor: pointer;
width: 24px;
margin-right: 10px;
height: 24px;
}
}
.regist {

View File

@ -15,6 +15,23 @@ export function unitPrice(val, unit, location) {
}
return (unit || '') + price
}
// 转义
export function enCode(v1) {
var entry = {
"&#39;": "'",
"&lt;": "<",
"&gt;": ">",
"&#40;": "(",
"&#41;": ")"
};
v1 = v1.replace(/(&#39;)|(&lt;)|(&gt;)|(&#40;)|(&#41;)|\s/gi, function($0) {
return entry[$0] || $0;
});
return v1;
}
/**
* 订单来源

View File

@ -4,7 +4,8 @@
<div class="mb_10">
<Button @click="addParent" icon="md-add">添加一级分类</Button>
</div>
<Table :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData" :columns="columns">
<Table class="table" :load-data="handleLoadData" row-key="id" :loading="loading" :data="tableData"
:columns="columns">
<template slot="action" slot-scope="scope">
<Dropdown v-show="scope.row.level == 2" trigger="click">
<Button size="small">
@ -32,7 +33,8 @@
</DropdownMenu>
</Dropdown>
&nbsp;
<Button v-show="scope.row.level != 2" type="primary" @click="addChildren(scope.row)" size="small" icon="md-add" style="margin-right: 5px">
<Button v-show="scope.row.level != 2" type="primary" @click="addChildren(scope.row)" size="small"
icon="md-add" style="margin-right: 5px">添加子分类
</Button>
</template>
@ -41,7 +43,8 @@
</template>
<template slot="deleteFlag" slot-scope="{row}">
<Tag :class="{'ml_10': row.deleteFlag}" :color="row.deleteFlag == false ? 'success' : 'error'">{{row.deleteFlag == false ? '正常启用' : '禁用'}}</Tag>
<Tag :class="{'ml_10': row.deleteFlag}" :color="row.deleteFlag == false ? 'success' : 'error'">
{{row.deleteFlag == false ? '正常启用' : '禁用'}}</Tag>
</template>
</Table>
@ -130,7 +133,7 @@ import {regular} from "@/utils";
export default {
name: "goods-category",
components: {
uploadPicInput
uploadPicInput,
},
data() {
return {
@ -168,9 +171,9 @@ export default {
//
formValidate: {
commissionRate: [
{required: true, message: '请填写佣金比例'},
{ required: true, message: "请填写佣金比例" },
{ pattern: regular.Integer, message: "佣金比例不能为负" },
]
],
},
columns: [
{
@ -189,7 +192,6 @@ export default {
slot: "commissionRate",
},
{
fixed: "right",
title: "操作",
key: "action",
@ -466,4 +468,11 @@ export default {
};
</script>
<style lang="scss" scoped>
/deep/ .ivu-table-wrapper {
overflow: auto;
}
.table {
min-height: 100vh;
height: auto;
}
</style>

View File

@ -88,7 +88,7 @@ export default {
overflow-y: auto;
}
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
color: #ed3f14;
color: $theme_color;
}
/deep/.ivu-menu-vertical .ivu-menu-item-group-title {
height: 40px;

View File

@ -196,8 +196,11 @@ export default {
},
},
watch: {
value(val) {
this.setData(val);
value: {
handler: function (val) {
//
this.setData(this.$options.filters.enCode(val));
},
},
},
mounted() {

View File

@ -15,6 +15,23 @@ export function unitPrice(val, unit, location) {
}
return (unit || "") + price;
}
// 转义
export function enCode(v1) {
var entry = {
"&#39;": "'",
"&lt;": "<",
"&gt;": ">",
"&#40;": "(",
"&#41;": ")"
};
v1 = v1.replace(/(&#39;)|(&lt;)|(&gt;)|(&#40;)|(&#41;)|\s/gi, function($0) {
return entry[$0] || $0;
});
return v1;
}
/**
* 订单来源

View File

@ -250,4 +250,11 @@ export default {
};
</script>
<style lang="scss" scoped>
/deep/ .ivu-table-wrapper {
overflow: auto;
}
.table {
min-height: 100vh;
height: auto;
}
</style>

View File

@ -73,3 +73,8 @@ export default {
}
};
</script>
<style lang="scss" scoped>
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
color: $theme_color;
}
</style>

View File

@ -197,7 +197,7 @@ export default {
value: {
handler: function (val) {
//
this.setData(val);
this.setData(this.$options.filters.enCode(val));
},
},
},