|
|
|
@ -37,7 +37,14 @@
|
|
|
|
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
|
|
|
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
|
|
|
|
|
|
|
|
|
|
|
|
<div style="display: flex; justify-content: space-between;align-items: center;margin-bottom: 10px">
|
|
|
|
|
|
|
|
<el-checkbox v-model="loginForm.rememberMe" >记住密码</el-checkbox>
|
|
|
|
|
|
|
|
<el-link icon="el-icon-thumb" type="success" @click="sqActive">更新授权</el-link>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div v-show="day && day!=='undefined'" style="text-align: right; margin-bottom: 20px;font-size: 14px; color: red">距授权到期还有 {{ day }} 天,请及时更新授权</div>
|
|
|
|
|
|
|
|
|
|
|
|
<el-form-item style="width:100%;">
|
|
|
|
<el-form-item style="width:100%;">
|
|
|
|
<el-button
|
|
|
|
<el-button
|
|
|
|
:loading="loading"
|
|
|
|
:loading="loading"
|
|
|
|
@ -53,16 +60,40 @@
|
|
|
|
<router-link class="link-type" :to="'/register'">立即注册</router-link>
|
|
|
|
<router-link class="link-type" :to="'/register'">立即注册</router-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 底部 -->
|
|
|
|
<!-- 底部 -->
|
|
|
|
<!-- <div class="el-login-footer">-->
|
|
|
|
<!-- <div class="el-login-footer">-->
|
|
|
|
<!-- <span>Copyright © 2018-2025 ruoyi.vip All Rights Reserved.</span>-->
|
|
|
|
<!-- <span>Copyright © 2018-2025 ruoyi.vip All Rights Reserved.</span>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 授权 -->
|
|
|
|
|
|
|
|
<el-dialog title="授权" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
|
|
|
<el-form-item label="授权密钥" prop="licenseKey">
|
|
|
|
|
|
|
|
<el-input v-model="form.licenseKey" placeholder="请输入授权密钥" />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="到期日期" prop="expireDate">
|
|
|
|
|
|
|
|
<el-date-picker style="width: 100%"
|
|
|
|
|
|
|
|
v-model="form.expireDate"
|
|
|
|
|
|
|
|
type="date"
|
|
|
|
|
|
|
|
placeholder="选择到期日期"
|
|
|
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
|
|
|
<el-button type="primary" @click="submitForm">激活授权</el-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { getCodeImg } from "@/api/login"
|
|
|
|
import { getCodeImg, activateLicense } from "@/api/login"
|
|
|
|
import Cookies from "js-cookie"
|
|
|
|
import Cookies from "js-cookie"
|
|
|
|
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
|
|
|
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
|
|
|
|
|
|
|
|
|
|
|
@ -93,7 +124,25 @@ export default {
|
|
|
|
captchaEnabled: true,
|
|
|
|
captchaEnabled: true,
|
|
|
|
// 注册开关
|
|
|
|
// 注册开关
|
|
|
|
register: false,
|
|
|
|
register: false,
|
|
|
|
redirect: undefined
|
|
|
|
redirect: undefined,
|
|
|
|
|
|
|
|
// 授权时间还有 day 天到期
|
|
|
|
|
|
|
|
day: null,
|
|
|
|
|
|
|
|
// 是否显示授权弹出层
|
|
|
|
|
|
|
|
open: false,
|
|
|
|
|
|
|
|
// 表单参数
|
|
|
|
|
|
|
|
form: {
|
|
|
|
|
|
|
|
licenseKey: "",
|
|
|
|
|
|
|
|
expireDate: ""
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
|
|
licenseKey: [
|
|
|
|
|
|
|
|
{ required: true, message: "授权密钥不能为空", trigger: "blur" }
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
expireDate: [
|
|
|
|
|
|
|
|
{ required: true, message: "到期日期不能为空", trigger: "blur" }
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
@ -105,8 +154,10 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getCode()
|
|
|
|
this.day = localStorage.getItem('licenseWarning')||null;
|
|
|
|
this.getCookie()
|
|
|
|
console.log('day',this.day);
|
|
|
|
|
|
|
|
this.getCode();
|
|
|
|
|
|
|
|
this.getCookie();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
getCode() {
|
|
|
|
getCode() {
|
|
|
|
@ -151,6 +202,28 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
reset(){
|
|
|
|
|
|
|
|
this.form = {
|
|
|
|
|
|
|
|
licenseKey: "",
|
|
|
|
|
|
|
|
expireDate: ""
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.resetForm("form")
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
// 授权
|
|
|
|
|
|
|
|
sqActive(){
|
|
|
|
|
|
|
|
this.reset()
|
|
|
|
|
|
|
|
this.open = true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
submitForm() {
|
|
|
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
activateLicense(this.form).then(response => {
|
|
|
|
|
|
|
|
this.$modal.msgSuccess("授权成功");
|
|
|
|
|
|
|
|
this.open = false
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|