diff --git a/.drone.yml b/.drone.yml index 8f63e02..4613a90 100644 --- a/.drone.yml +++ b/.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/* diff --git a/apps/server/src/controller/user.controller.ts b/apps/server/src/controller/user.controller.ts index 6fa731f..b3f205b 100644 --- a/apps/server/src/controller/user.controller.ts +++ b/apps/server/src/controller/user.controller.ts @@ -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) { diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index bb4c8f6..f579897 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -34,7 +34,13 @@ function App() { 404} /> - + ); } diff --git a/apps/web/src/components/Nav/index.less b/apps/web/src/components/Nav/index.less index b64caa5..9811bdc 100644 --- a/apps/web/src/components/Nav/index.less +++ b/apps/web/src/components/Nav/index.less @@ -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; diff --git a/apps/web/src/components/Nav/index.tsx b/apps/web/src/components/Nav/index.tsx index 208208f..62aa784 100644 --- a/apps/web/src/components/Nav/index.tsx +++ b/apps/web/src/components/Nav/index.tsx @@ -113,7 +113,14 @@ function Nav() { */}
- 设置 + + 设置 + diff --git a/apps/web/src/store/modal.store.ts b/apps/web/src/store/modal.store.ts deleted file mode 100644 index 43a567f..0000000 --- a/apps/web/src/store/modal.store.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { create } from "zustand"; - -export const useLoginModalStore = create((set) => { - return { - visible: false, - setVisible: () => set({ visible: true }), - setInVisible: () => set({ visible: false }), - }; -}); diff --git a/apps/web/src/store/user.store.ts b/apps/web/src/store/user.store.ts index afb3184..ca6d6b9 100644 --- a/apps/web/src/store/user.store.ts +++ b/apps/web/src/store/user.store.ts @@ -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("再见~!"); }, }; }); diff --git a/apps/web/src/view/Course/index.less b/apps/web/src/view/Course/index.less index 9f846df..c209cff 100644 --- a/apps/web/src/view/Course/index.less +++ b/apps/web/src/view/Course/index.less @@ -68,7 +68,7 @@ } .mask { p { - font-size: 15px; + font-size: 20px; } } } diff --git a/apps/web/src/view/Login/index.tsx b/apps/web/src/view/Login/index.tsx index b13e8b3..db9b44c 100644 --- a/apps/web/src/view/Login/index.tsx +++ b/apps/web/src/view/Login/index.tsx @@ -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); }); diff --git a/apps/web/src/view/Subscribe/index.tsx b/apps/web/src/view/Subscribe/index.tsx index f308daf..d99ff34 100644 --- a/apps/web/src/view/Subscribe/index.tsx +++ b/apps/web/src/view/Subscribe/index.tsx @@ -33,19 +33,19 @@ function Subscribe() { */}
  • - +
    全部课程观看免费
  • - +
    私人小群
  • - +
    物料下载
    diff --git a/package.json b/package.json index 70e54f8..6e8d4ed 100644 --- a/package.json +++ b/package.json @@ -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"