refactor editor
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<t-form-item label="验证码" name="captcha">
|
||||
<div class="captcha-box">
|
||||
<t-input class="captcha" v-model="loginRequest.captcha" placeholder="" />
|
||||
<captcha :api="CommonAPI.getCaptchaAPI()" :width="90" :height="28" :from="CaptchaFrom.LOGIN" />
|
||||
<captcha :api="CommonAPI.getCaptchaAPI()" :width="90" :height="28" />
|
||||
</div>
|
||||
</t-form-item>
|
||||
<div class="exec">
|
||||
@@ -24,7 +24,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { Captcha, CaptchaData, CaptchaFrom, CommonAPI, LoginRequest, UserAPI, userStore } from "timi-web";
|
||||
import { Captcha, CaptchaData, CommonAPI, LoginRequest, UserAPI } from "timi-web";
|
||||
import { Emits, useHandler } from "~/components/authorize-form/emits";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
|
||||
@@ -55,7 +55,7 @@ const { onLoginSuccess } = useHandler(emits);
|
||||
const doSubmitting = ref<boolean>(false);
|
||||
|
||||
const loginRequest = reactive<CaptchaData<LoginRequest>>({
|
||||
from: CaptchaFrom.LOGIN,
|
||||
captchaId: "",
|
||||
captcha: "",
|
||||
data: {
|
||||
user: "",
|
||||
@@ -66,7 +66,7 @@ const loginRequest = reactive<CaptchaData<LoginRequest>>({
|
||||
const doSubmit = async () => {
|
||||
doSubmitting.value = true;
|
||||
UserAPI.login(loginRequest).then(async (response) => {
|
||||
await userStore.updateToken(response);
|
||||
// await userStore.updateToken(response);
|
||||
await onLoginSuccess();
|
||||
doSubmitting.value = false;
|
||||
}).catch(msg => {
|
||||
|
||||
Reference in New Issue
Block a user