yb 10 mesiacov pred
rodič
commit
f21e20305f

+ 42 - 7
bash/run.sh

@@ -112,16 +112,52 @@ test_unzip() {
 }
 
 trigger_jenkins() {
-    JENKINS_URL="https://code.ifoodme.com/job/online-order-vue/build"
+    JENKINS_URL="https://code.ifoodme.com/job/online-order-vue"
     JENKINS_TOKEN="11d3ef87866e3756c131425ef09d705002"
+    USERNAME="wangyibu123"
+    
     echo "触发 Jenkins 任务..."
-    curl -X POST "$JENKINS_URL" --user "username:$JENKINS_TOKEN"
-    if [ $? -eq 0 ]; then
-        echo -e "${GREEN}Jenkins 任务触发成功${NC}"
-    else
-        echo -e "${RED}Jenkins 任务触发失败${NC}"
+    # 触发构建并获取队列位置
+    QUEUE_URL=$(curl -s -X POST "$JENKINS_URL/build" \
+        --user "$USERNAME:$JENKINS_TOKEN" \
+        -H "Jenkins-Crumb: $(curl -s "$JENKINS_URL/crumbIssuer/api/xml" --user "$USERNAME:$JENKINS_TOKEN" | grep -oP '<crumb>\K[^<]+')" \
+        -I | grep -i "Location:" | awk '{print $2}' | tr -d '\r')
+    
+    if [ -z "$QUEUE_URL" ]; then
+        echo -e "\033[31mJenkins 任务触发失败\033[0m"
         exit 1
     fi
+    
+    echo "等待任务进入构建队列..."
+    # 等待获取构建号
+    while true; do
+        BUILD_URL=$(curl -s "$QUEUE_URL/api/json" --user "$USERNAME:$JENKINS_TOKEN" | jq -r '.executable.url // ""')
+        if [ -n "$BUILD_URL" ]; then
+            BUILD_NUMBER=$(basename "$BUILD_URL")
+            echo "任务开始构建,构建号: $BUILD_NUMBER"
+            break
+        fi
+        sleep 5
+    done
+    
+    echo "等待任务完成..."
+    # 监控构建状态
+    while true; do
+        STATUS=$(curl -s "$BUILD_URL/api/json" --user "$USERNAME:$JENKINS_TOKEN" | jq -r '.result // "RUNNING"')
+        if [ "$STATUS" != "RUNNING" ] && [ "$STATUS" != "null" ]; then
+            if [ "$STATUS" == "SUCCESS" ]; then
+                echo -e "\033[32mJenkins 任务完成 - 成功\033[0m"
+                # 获取并返回构建结果
+                curl -s "$BUILD_URL/consoleText" --user "$USERNAME:$JENKINS_TOKEN"
+                return 0
+            else
+                echo -e "\033[31mJenkins 任务完成 - 失败 ($STATUS)\033[0m"
+                curl -s "$BUILD_URL/consoleText" --user "$USERNAME:$JENKINS_TOKEN"
+                return 1
+            fi
+        fi
+        sleep 10
+    done
 }
 
 # 清理
@@ -141,7 +177,6 @@ main() {
     test_unzip
     upload_ftp
     cleanup
-    # trigger jenkins 任务
     trigger_jenkins
     echo -e "${GREEN}所有任务完成!${NC}"
 }

+ 1 - 1
src/api/login/types.ts

@@ -10,7 +10,7 @@ export type UserLoginVO = {
 export type UserRegisterVO = {
   mobile: string
   password: string
-  code: string
+  code?: string
 }
 
 export type TokenType = {

+ 2 - 3
src/views/Login/Login.vue

@@ -62,7 +62,7 @@
   </div>
 </template>
 <script lang="ts" name="Login" setup>
-import { underlineToHump } from '@/utils'
+// import { underlineToHump } from '@/utils'
 
 import { useDesign } from '@/hooks/web/useDesign'
 import { useAppStore } from '@/store/modules/app'
@@ -71,8 +71,7 @@ import { useAppStore } from '@/store/modules/app'
 
 import { LoginForm } from './components'
 // import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'
-
-const { t } = useI18n()
+// const { t } = useI18n()
 const appStore = useAppStore()
 const { getPrefixCls } = useDesign()
 const prefixCls = getPrefixCls('login')

+ 1 - 1
src/views/Login/Register.vue

@@ -59,7 +59,7 @@ import { useAppStore } from '@/store/modules/app'
 import { RegisterForm } from './components'
 // import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'
 
-const { t } = useI18n()
+// const { t } = useI18n()
 const appStore = useAppStore()
 const { getPrefixCls } = useDesign()
 const prefixCls = getPrefixCls('login')

+ 27 - 30
src/views/Login/components/RegisterForm.vue

@@ -9,13 +9,13 @@
     label-width="120px"
     size="large"
   >
-    <el-row style="maring-left: -10px; maring-right: -10px">
-      <el-col :span="24" style="padding-left: 10px; padding-right: 10px">
+    <el-row>
+      <el-col :span="24">
         <el-form-item>
-          <LoginFormTitle style="width: 100%" />
+          <LoginFormTitle />
         </el-form-item>
       </el-col>
-      <el-col v-if="locale" :span="24" style="padding-left: 10px; padding-right: 10px">
+      <el-col v-if="locale" :span="24">
         <el-form-item>
           <LocaleSelect />
         </el-form-item>
@@ -77,7 +77,7 @@ import { useAppStore } from '@/store/modules/app'
 const { t } = useI18n()
 //const message = useMessage()
 const iconAvatar = useIcon({ icon: 'ep:avatar' })
-const iconLock = useIcon({ icon: 'ep:lock' })
+// const iconLock = useIcon({ icon: 'ep:lock' })
 const formLogin = ref()
 const { validForm } = useFormValid(formLogin)
 const { getLoginState, setLoginState } = useLoginState()
@@ -85,8 +85,8 @@ const { currentRoute, push } = useRouter()
 const permissionStore = usePermissionStore()
 const redirect = ref<string>('')
 const loginLoading = ref(false)
-const verify = ref()
-const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
+// const verify = ref()
+// const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
 const appStore = useAppStore()
 const locale = computed(() => appStore.getLocale)
 const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
@@ -106,19 +106,18 @@ const registerData = reactive({
 })
 
 // 获取验证码
-const getCode = async () => {
-  // 情况一,未开启:则直接登录
-  console.log('oginData.captchaEnable:', registerData.captchaEnable)
-  if (registerData.captchaEnable === 'false') {
-    // await register({
-
-    // })
-  } else {
-    // 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
-    // 弹出验证码
-    // verify.value.show()
-  }
-}
+// const getCode = async () => {
+//   // 情况一,未开启:则直接登录
+//   console.log('oginData.captchaEnable:', registerData.captchaEnable)
+//   if (registerData.captchaEnable === 'false') {
+//     // await register({
+//     // })
+//   } else {
+//     // 情况二,已开启:则展示验证码;只有完成验证码的情况,才进行登录
+//     // 弹出验证码
+//     // verify.value.show()
+//   }
+// }
 //获取租户ID
 const getTenantId = async () => {
   // if (registerData.tenantEnable === 'true') {
@@ -145,8 +144,8 @@ const register = async () => {
     if (!data) {
       return
     }
-    registerData.registerForm.captchaVerification = params.captchaVerification
-    const res = await LoginApi.login(registerData.registerForm)
+    // registerData.registerForm.captchaVerification = params.captchaVerification
+    const res = await LoginApi.register(registerData.registerForm)
     if (!res) {
       return
     }
@@ -155,11 +154,11 @@ const register = async () => {
       text: t('login.loadingSystem'),
       background: 'rgba(0, 0, 0, 0.7)'
     })
-    if (registerData.registerForm.rememberMe) {
-      authUtil.setLoginForm(registerData.registerForm)
-    } else {
-      authUtil.removeLoginForm()
-    }
+    // if (registerData.registerForm) {
+    //   authUtil.setLoginForm(registerData.registerForm)
+    // } else {
+    //   authUtil.removeLoginForm()
+    // }
     authUtil.setToken(res)
     if (!redirect.value) {
       redirect.value = '/'
@@ -195,6 +194,4 @@ onMounted(() => {
 })
 </script>
 
-<style lang="scss" scoped>
-
-</style>
+<style lang="scss" scoped></style>

+ 4 - 4
tsconfig.json

@@ -24,11 +24,11 @@
       "@/*": ["src/*"]
     },
     "types": [
-      "@intlify/unplugin-vue-i18n/types",
       "vite/client",
-      "element-plus/global",
-      "@types/qrcode",
-      "vite-plugin-svg-icons/client"
+      // "@types/qrcode",
+      // "@intlify/unplugin-vue-i18n/types",
+      // "element-plus/global",
+      // "vite-plugin-svg-icons/client"
     ],
     "outDir": "target", // 请保留这个属性,防止tsconfig.json文件报错
     "typeRoots": ["./node_modules/@types/", "./types"]