| | |
| | | <Col class="content"> |
| | | <div> |
| | | <Header /> |
| | | <div v-if="!socialLogining"> |
| | | <div class="login-main-box" v-if="!socialLogining"> |
| | | <div class="login-img"> |
| | | <img src="../assets/img/login-mmain-left-bj.jpg" alt=""> |
| | | </div> |
| | | <div class="login-form"> |
| | | <div class="login-form-inside"> |
| | | <Form |
| | | ref="usernameLoginForm" |
| | | :model="form" |
| | |
| | | class="form" |
| | | v-if="tabName == 'username'" |
| | | > |
| | | <FormItem> |
| | | <!--<h1 style="margin-left: 40%;">登 录</h1>--> |
| | | <h1>安全配送管理系统</h1> |
| | | </FormItem> |
| | | <FormItem prop="username"> |
| | | <Input |
| | | v-model="form.username" |
| | |
| | | autocomplete="off" |
| | | /> |
| | | </FormItem> |
| | | <!--<FormItem prop="imgCode">--> |
| | | <!--<Row--> |
| | | <!--type="flex"--> |
| | | <!--justify="space-between"--> |
| | | <!--style="align-items: center; overflow: hidden"--> |
| | | <!-->--> |
| | | <!--<Input--> |
| | | <!--v-model="form.imgCode"--> |
| | | <!--size="large"--> |
| | | <!--clearable--> |
| | | <!--placeholder="请输入图片验证码"--> |
| | | <!--:maxlength="10"--> |
| | | <!--class="input-verify"--> |
| | | <!--/>--> |
| | | <!--<div--> |
| | | <!--class="code-image"--> |
| | | <!--style="position: relative; font-size: 12px"--> |
| | | <!-->--> |
| | | <!--<Spin v-if="loadingCaptcha" fix></Spin>--> |
| | | <!--<img--> |
| | | <!--:src="captchaImg"--> |
| | | <!--@click="getCaptchaImg"--> |
| | | <!--alt="加载验证码失败"--> |
| | | <!--style="width: 110px; cursor: pointer; display: block"--> |
| | | <!--/>--> |
| | | <!--</div>--> |
| | | <!--</Row>--> |
| | | <!--</FormItem>--> |
| | | <FormItem prop="imgCode"> |
| | | <Row |
| | | type="flex" |
| | | justify="space-between" |
| | | style="align-items: center; overflow: hidden" |
| | | > |
| | | <Input |
| | | v-model="form.imgCode" |
| | | size="large" |
| | | clearable |
| | | placeholder="请输入图片验证码" |
| | | :maxlength="10" |
| | | class="input-verify" |
| | | /> |
| | | <div |
| | | class="code-image" |
| | | style="position: relative; font-size: 12px" |
| | | > |
| | | <Spin v-if="loadingCaptcha" fix></Spin> |
| | | <img |
| | | :src="captchaImg" |
| | | @click="getCaptchaImg" |
| | | alt="加载验证码失败" |
| | | style="width: 110px; cursor: pointer; display: block" |
| | | /> |
| | | </div> |
| | | </Row> |
| | | </FormItem> |
| | | </Form> |
| | | |
| | | <!--<Row justify="space-between" align="middle">--> |
| | | <!--<Checkbox v-model="saveLogin" size="large">{{--> |
| | | <!--<Row justify="space-between" align="middle">--> |
| | | <!--<Checkbox v-model="saveLogin" size="large">{{--> |
| | | <!--$t("autoLogin")--> |
| | | <!--}}</Checkbox>--> |
| | | <!--<Dropdown trigger="click" @on-click="handleDropDown">--> |
| | | <!--<Dropdown trigger="click" @on-click="handleDropDown">--> |
| | | <!--<a class="forget-pass">{{ $t("forgetPass") }}</a>--> |
| | | <!--<DropdownMenu slot="list">--> |
| | | <!--<DropdownItem name="test">体验测试账号</DropdownItem>--> |
| | | <!--<DropdownItem name="resetByMobile"--> |
| | | <!-->使用手机号重置密码(付费)</DropdownItem--> |
| | | <!-->--> |
| | | <!--<DropdownItem name="resetByEmail"--> |
| | | <!-->使用邮箱重置密码(付费)</DropdownItem--> |
| | | <!-->--> |
| | | <!--<DropdownItem name="test">体验测试账号</DropdownItem>--> |
| | | <!--<DropdownItem name="resetByMobile"--> |
| | | <!-->使用手机号重置密码(付费)</DropdownItem--> |
| | | <!-->--> |
| | | <!--<DropdownItem name="resetByEmail"--> |
| | | <!-->使用邮箱重置密码(付费)</DropdownItem--> |
| | | <!-->--> |
| | | <!--</DropdownMenu>--> |
| | | <!--</Dropdown>--> |
| | | <!--</Row>--> |
| | | <Button |
| | | class="login-btn" |
| | | type="primary" |
| | | size="large" |
| | | :loading="loading" |
| | | @click="submitLogin" |
| | | long |
| | | > |
| | | <span v-if="!loading">{{ $t("login") }}</span> |
| | | <span v-else>{{ $t("logining") }}</span> |
| | | </Button> |
| | | <!--</Dropdown>--> |
| | | <!--</Row>--> |
| | | <Button |
| | | class="login-btn" |
| | | type="primary" |
| | | size="large" |
| | | :loading="loading" |
| | | @click="submitLogin" |
| | | long |
| | | > |
| | | <span v-if="!loading">{{ $t("login") }}</span> |
| | | <span v-else>{{ $t("logining") }}</span> |
| | | </Button> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div v-if="socialLogining"> |
| | | <RectLoading /> |
| | | </div> |
| | | </div> |
| | | <!--<Footer />--> |
| | | </Col> |
| | | <LangSwitch /> |
| | | <!--<LangSwitch />--> |
| | | </Row> |
| | | </div> |
| | | <!--<div>--> |
| | |
| | | <!--</VueFurcateTree>--> |
| | | |
| | | <!--</div>--> |
| | | |
| | | |
| | | </template> |
| | | |
| | |
| | | ] |
| | | } |
| | | ], |
| | | sessionStorage: null, |
| | | showMore: false, |
| | | code:"", |
| | | captchaId: "", |
| | | captchaImg: "", |
| | | loadingCaptcha: true, |
| | |
| | | password: "", |
| | | code: "", |
| | | }, |
| | | showChangePass: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | initCaptcha().then((res) => { |
| | | this.loadingCaptcha = false; |
| | | if (res.success) { |
| | | this.captchaId = res.result; |
| | | this.code = res.result.code; |
| | | this.captchaId = res.result.captchaId; |
| | | this.captchaImg = drawCodeImage + this.captchaId; |
| | | } |
| | | }); |
| | |
| | | }, |
| | | afterLogin(res) { |
| | | let accessToken = res.result; |
| | | this.setStore("accessToken", accessToken); |
| | | console.log("login_afterLogin()",accessToken) |
| | | this.setSessionStore("accessToken", accessToken); |
| | | getOtherSet().then((res) => { |
| | | if (res.result) { |
| | | let domain = res.result.ssoDomain; |
| | | Cookies.set("accessToken", accessToken, { |
| | | domain: domain, |
| | | expires: 7, |
| | | }); |
| | | // Cookies.set("accessToken", accessToken, { |
| | | // domain: domain, |
| | | // expires: 7, |
| | | // }); |
| | | } |
| | | }); |
| | | // 获取用户信息 |
| | |
| | | }, |
| | | submitLogin() { |
| | | if (this.tabName == "username") { |
| | | if(this.code.toUpperCase()!=this.form.imgCode.toUpperCase()){ |
| | | this.$Message.error("验证码错误"); |
| | | this.getCaptchaImg(); |
| | | return |
| | | } |
| | | this.loading = true; |
| | | login({ |
| | | username: this.form.username, |
| | | password: this.form.password, |
| | | password: btoa(this.form.password), |
| | | code: this.form.imgCode, |
| | | captchaId: this.captchaId, |
| | | saveLogin: this.saveLogin, |
| | |
| | | if (res.success) { |
| | | this.socialLogining = true; |
| | | let accessToken = res.result; |
| | | this.setStore("accessToken", accessToken); |
| | | this.setSessionStore("accessToken", accessToken); |
| | | getOtherSet().then((res) => { |
| | | if (res.result) { |
| | | let domain = res.result.ssoDomain; |
| | | Cookies.set("accessToken", accessToken, { |
| | | domain: domain, |
| | | expires: 7, |
| | | }); |
| | | // Cookies.set("accessToken", accessToken, { |
| | | // domain: domain, |
| | | // expires: 7, |
| | | // }); |
| | | } |
| | | }); |
| | | // 获取用户信息 |
| | |
| | | }); |
| | | }, |
| | | test() { |
| | | this.$Notice.info({ |
| | | title: "测试体验账号", |
| | | desc: "账号:test或test2<br>密码:123456", |
| | | }); |
| | | // this.$Notice.info({ |
| | | // title: "测试体验账号", |
| | | // desc: "账号:test或test2<br>密码:123456", |
| | | // }); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | //this.showNotice(); |
| | | this.relatedLogin(); |
| | | //this.getCaptchaImg(); |
| | | this.getCaptchaImg(); |
| | | |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .login-main-box{ |
| | | .ivu-form-item{ |
| | | margin-bottom: 2vw; |
| | | &:first-child{ |
| | | margin-bottom: 4vw; |
| | | } |
| | | } |
| | | .ivu-form-item-content{ |
| | | h1{ |
| | | font-size: 1.5vw; |
| | | text-align: center; |
| | | } |
| | | } |
| | | .ivu-input-large{ |
| | | height: 2vw; |
| | | } |
| | | .ivu-input-wrapper-large .ivu-input-prefix i, .ivu-input-wrapper-large .ivu-input-suffix i{ |
| | | line-height: 2vw; |
| | | } |
| | | .ivu-input{ |
| | | border: 1px solid #aaaaaa; |
| | | } |
| | | } |
| | | |
| | | </style> |
| | | <style lang="less"> |
| | | @import "./login.less"; |
| | | </style> |