feat: build admin
This commit is contained in:
parent
a807f2c557
commit
9115293095
27
.drone.yml
27
.drone.yml
|
@ -36,3 +36,30 @@ steps:
|
|||
command_timeout: 2m
|
||||
target: /www/wwwroot/nginx/html/backset.cn/
|
||||
source: ./apps/web/dist/*
|
||||
|
||||
- name: build-admin
|
||||
image: node:16.19-alpine
|
||||
# 容器内挂载点
|
||||
volumes:
|
||||
- name: node_modules
|
||||
path: /drone/src/node_modules
|
||||
commands:
|
||||
- pwd
|
||||
- node -v
|
||||
- npm -v
|
||||
- npm install -g pnpm
|
||||
- pnpm install
|
||||
- pnpm build:admin
|
||||
|
||||
- name: deploy-admin
|
||||
image: appleboy/drone-scp:1.6
|
||||
settings:
|
||||
host:
|
||||
- backset.cn
|
||||
username: root
|
||||
password: cr654654.
|
||||
port: 22
|
||||
overwrite: true
|
||||
command_timeout: 2m
|
||||
target: /www/wwwroot/nginx/html/backset.cn/
|
||||
source: ./apps/admin/dist/*
|
||||
|
|
|
@ -97,13 +97,7 @@ export class UserController {
|
|||
try {
|
||||
const { phoneNumber: phoneNumbers } = params;
|
||||
const code = Math.floor(Math.random() * 9000 + 1000);
|
||||
const res = await this.redisService.set(
|
||||
'' + phoneNumbers,
|
||||
code,
|
||||
'EX',
|
||||
60
|
||||
);
|
||||
console.log('redis here', res);
|
||||
await this.redisService.set('' + phoneNumbers, code, 'EX', 60);
|
||||
await this.smsService.send({ code, phoneNumbers });
|
||||
return { code: BizCode.OK };
|
||||
} catch (error) {
|
||||
|
|
|
@ -34,7 +34,13 @@ function App() {
|
|||
<Route path="*" element={<span>404</span>} />
|
||||
</Routes>
|
||||
</main>
|
||||
<Toaster />
|
||||
<Toaster
|
||||
toastOptions={{
|
||||
style: {
|
||||
fontSize: 14,
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ header {
|
|||
.middle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
|
||||
> span {
|
||||
color: #d7d7d7;
|
||||
|
@ -51,6 +52,7 @@ header {
|
|||
}
|
||||
|
||||
.end {
|
||||
font-size: 14px;
|
||||
.btn {
|
||||
cursor: pointer;
|
||||
margin-left: 32px;
|
||||
|
|
|
@ -113,7 +113,14 @@ function Nav() {
|
|||
</Icon>
|
||||
</div> */}
|
||||
<div className="bs fc sb">
|
||||
<span>设置</span>
|
||||
<span
|
||||
style={{
|
||||
textDecoration: "line-through",
|
||||
color: "var(--color-text-4)",
|
||||
}}
|
||||
>
|
||||
设置
|
||||
</span>
|
||||
<Icon color="var(--color-text-3)">
|
||||
<Settings20Regular />
|
||||
</Icon>
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
import { create } from "zustand";
|
||||
|
||||
export const useLoginModalStore = create((set) => {
|
||||
return {
|
||||
visible: false,
|
||||
setVisible: () => set({ visible: true }),
|
||||
setInVisible: () => set({ visible: false }),
|
||||
};
|
||||
});
|
|
@ -1,6 +1,7 @@
|
|||
import { create } from "zustand";
|
||||
import Cookie from "js-cookie";
|
||||
import { userState } from "../api";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export const useUserStore = create((set) => {
|
||||
return {
|
||||
|
@ -18,6 +19,7 @@ export const useUserStore = create((set) => {
|
|||
set({ user: null });
|
||||
Cookie.remove("_sign_web");
|
||||
Cookie.remove("_sign_web.sig");
|
||||
toast.success("再见~!");
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
}
|
||||
.mask {
|
||||
p {
|
||||
font-size: 15px;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ import { sms, userLogin } from "../../api";
|
|||
import "./index.less";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useUserStore } from "../../store/user.store";
|
||||
import toast from "react-hot-toast";
|
||||
const defaultForm = {
|
||||
user_login: "",
|
||||
user_pass: "",
|
||||
|
@ -19,11 +20,11 @@ export function Login() {
|
|||
|
||||
const onClickSmsBtn = () => {
|
||||
if (!/^1[3456789]\d{9}$/.test(loginForm.user_login))
|
||||
return alert("手机号格式有误");
|
||||
return toast.error("手机号格式有误");
|
||||
sms(loginForm.user_login).then((res: any) => {
|
||||
if (res?.code === 10000)
|
||||
setTimeout(() => {
|
||||
alert("验证码已发送");
|
||||
toast.success("验证码已发送");
|
||||
timer.current = setInterval(() => setCountdown(countdown--), 1000);
|
||||
}, 50);
|
||||
});
|
||||
|
|
|
@ -33,19 +33,19 @@ function Subscribe() {
|
|||
</button> */}
|
||||
<ul>
|
||||
<li>
|
||||
<Icon size={20}>
|
||||
<Icon size={20} color="green">
|
||||
<Checkmark12Filled />
|
||||
</Icon>
|
||||
<div>全部课程观看免费</div>
|
||||
</li>
|
||||
<li>
|
||||
<Icon size={20}>
|
||||
<Icon size={20} color="green">
|
||||
<Checkmark12Filled />
|
||||
</Icon>
|
||||
<div>私人小群</div>
|
||||
</li>
|
||||
<li>
|
||||
<Icon size={20}>
|
||||
<Icon size={20} color="green">
|
||||
<Checkmark12Filled />
|
||||
</Icon>
|
||||
<div>物料下载</div>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
"dev:apps-web": "cd apps/web && pnpm dev",
|
||||
"dev:apps-admin": "cd apps/admin && pnpm dev",
|
||||
"build:web": "cd apps/web && pnpm build",
|
||||
"build:admin": "cd apps/admin && pnpm build",
|
||||
"build:pkgs": "pnpm build:ui && pnpm build:util",
|
||||
"build:ui": "cd packages/ui && pnpm build",
|
||||
"build:util": "cd packages/util && pnpm build"
|
||||
|
|
Loading…
Reference in New Issue
Block a user