shaogen1995 2 天之前
父節點
當前提交
0b0fd69583

+ 21 - 3
public/index.html

@@ -11,12 +11,19 @@
     <title>义乌市博物馆馆藏管理系统</title>
 
     <script>
-      // 域名地址
-      const baseUrlTempOne = 'https://sit-yiwubwg.4dage.com'
+      // 甲方域名地址
+      const baseUrlTempOne = 'https://ywgcxt.yw.gov.cn:9443'
+
+      // const baseUrlTempOne = 'https://ywgcxt.yw.gov.cn:8887'
+      // 测试域名地址
+      // const baseUrlTempOne = 'https://sit-yiwubwg.4dage.com'
       // const baseUrlTempOne = 'http://192.168.20.61:8096'
 
       // 钉钉模式
-      const isDingTemp = false
+      const isDingTemp = true
+
+      // 是否弹窗
+      const isMyAlert = true
 
       // const script = document.createElement('script')
       // script.src = `//${window.g_config.cdnHost}/gdt/dd-web-dev-center/3.12.0/assets/js/app_567f70b3-6512-4dca-8683-c2b5e2755fd0.js`
@@ -28,6 +35,17 @@
       //     observerElement: document.documentElement
       //   })
       // })
+
+      if (isMyAlert) {
+        window.onload = function () {
+          var script = document.createElement('script')
+          script.src = 'https://cdn.bootcss.com/eruda/1.5.4/eruda.min.js'
+          document.body.appendChild(script)
+          script.onload = function () {
+            eruda.init()
+          }
+        }
+      }
     </script>
 
     <!-- 埋点开始 -->

+ 21 - 2
src/components/DingLogin/index.tsx

@@ -2,11 +2,22 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
 import dd from 'gdt-jsapi'
 import styles from './index.module.scss'
 import { MessageFu } from '@/utils/message'
-import { API_ddLogin } from '@/store/action/layout'
+import { API_ddLogin, API_LoginGetCode } from '@/store/action/layout'
 import { Button } from 'antd'
 import { setTokenInfo } from '@/utils/storage'
 import history from '@/utils/history'
 function DingLogin() {
+  // 获取验证码
+  const LoginGetCodeFu = useCallback(async () => {
+    const res: any = await API_LoginGetCode()
+
+    console.log('pppp', res)
+  }, [])
+
+  useEffect(() => {
+    if (isMyAlert) LoginGetCodeFu()
+  }, [LoginGetCodeFu])
+
   const DDloginFu = useCallback(() => {
     dd.ready(function () {
       dd.getAuthCode({
@@ -14,7 +25,13 @@ function DingLogin() {
       })
         .then(async res1 => {
           const code = res1.auth_code
+
+          // if (isMyAlert) alert(`code:${code}`)
+
           const res = await API_ddLogin(code!)
+
+          // if (isMyAlert) alert(JSON.stringify(res))
+
           if (res.code === 0) {
             MessageFu.success('登录成功')
             // 用户信息存到本地
@@ -28,6 +45,8 @@ function DingLogin() {
           }
         })
         .catch(err => {
+          // if (isMyAlert) alert(JSON.stringify(err))
+
           MessageFu.error(err)
         })
     })
@@ -60,7 +79,7 @@ function DingLogin() {
     <div className={styles.DingLogin}>
       <div className='DingLoginBox'>
         <Button type='primary' size='large' onClick={() => setNum(0)}>
-          钉授权登录
+          浙政钉授权登录
         </Button>
         <h3 style={{ opacity: num <= 0 ? '0' : '1' }}>
           <span>{num}</span>秒之后自动登录

+ 0 - 2
src/components/ZmaiDian.ts

@@ -35,13 +35,11 @@ function setMd(page_id: string, page_name: string, page_url: string) {
     action: 'aplus.setMetaInfo',
     arguments: ['_user_nick', userInfo.realName || userInfo.userName || '匿名']
   })
-
   // 设置会员ID
   aplus_queue.push({
     action: 'aplus.setMetaInfo',
     arguments: ['_user_id', userInfo.accountId || '888708'] // 当前登录的浙政钉用户id,传参示例:uni.getStorageSync('userInfo').employeeCode)
   })
-
   // 如采集用户信息是异步行为,需要先设置完用户信息后再执行这个START埋点
   // 此时被block住的日志会携带上用户信息逐条发出
   aplus_queue.push({

+ 5 - 3
src/components/ZupFile/index.tsx

@@ -33,10 +33,12 @@ function ZupFile({ tableList, moduleId, isShow, closeFu, succFu }: Props) {
     // 支持上传文件夹
     directory: true,
     multiple: true,
+    // action: `${baseURL}${envFlag ? '' : '/api/'}cms/orderCollect/upload?tkToken=${getTokenFu()}`,
     action: `${baseURL}${envFlag ? '' : '/api/'}cms/orderCollect/upload`,
-    headers: {
-      token: getTokenFu()
-    },
+
+    // headers: {
+    //   token: getTokenFu()
+    // },
     // 上传的额外参数
     data: file => ({
       dirCode: 'collectUpFiles',

+ 3 - 2
src/pages/Layout/index.tsx

@@ -375,14 +375,14 @@ function Layout() {
             onMouseLeave={() => setIsUserBtnShow(false)}
           >
             <div
-              className={classNames('userNameBox', isDing ? 'userNameBoxDing' : '')}
+              className={classNames('userNameBox', isDing && !isMyAlert ? 'userNameBoxDing' : '')}
               onClick={() => setIsUserBtnShow(true)}
             >
               <img src={userInfo.thumb ? baseURL + userInfo.thumb : baseTouXiangImg} alt='' />
 
               {userInfo.realName || userInfo.userName || '匿名'}
 
-              {isDing ? null : (
+              {isDing && !isMyAlert ? null : (
                 <div className='userInco userInco2'>
                   <CaretRightOutlined />
                 </div>
@@ -392,6 +392,7 @@ function Layout() {
             <div className='userSet'>
               <div>
                 <span
+                  hidden={isDing}
                   onClick={() => store.dispatch({ type: 'layout/passEditShow', payload: true })}
                 >
                   修改密码

+ 1 - 0
src/types/declaration.d.ts

@@ -7,6 +7,7 @@ declare module '*.svg'
 declare module 'js-export-excel'
 declare module 'braft-utils'
 declare const isDingTemp: boolean
+declare const isMyAlert: boolean
 declare const baseUrlTempOne: string
 // 埋点信息
 declare const aplus_queue: any[]

+ 15 - 1
src/utils/http.ts

@@ -31,7 +31,7 @@ declare module 'axios' {
 // 创建 axios 实例
 const http = axios.create({
   baseURL: `${baseURL}${baseFlag ? '/api/' : ''}`,
-  timeout: 10000
+  timeout: 30000
 })
 
 let axajInd = 0
@@ -39,12 +39,22 @@ let axajInd = 0
 // 请求拦截器
 http.interceptors.request.use(
   function (config: any) {
+    // if (isMyAlert) alert(`开始发送接口:${JSON.stringify(config)}`)
     // 发请求前打开加载提示
     domShowFu('#AsyncSpinLoding', true)
 
     axajInd++
 
     const { token } = getTokenInfo()
+    // console.log(token)
+
+    // 如果 token 存在,将其作为查询参数添加到 URL
+    // if (token) {
+    //   // 检查 URL 是否已有查询参数
+    //   const separator = config.url.includes('?') ? '&' : '?'
+    //   config.url = `${config.url}${separator}tkToken=${encodeURIComponent(token)}`
+    // }
+
     if (token) config.headers.token = token
     return config
   },
@@ -58,6 +68,8 @@ let timeId = -1
 // 响应拦截器
 http.interceptors.response.use(
   function (response) {
+    // if (isMyAlert) alert(`发送请求成功:${JSON.stringify(response)}`)
+
     // 请求回来的关闭加载提示
     axajInd--
     if (axajInd === 0) {
@@ -83,6 +95,8 @@ http.interceptors.response.use(
     return response.data
   },
   async function (err) {
+    // if (isMyAlert) alert(`发送请求失败:${err}`)
+
     clearTimeout(timeId)
     timeId = window.setTimeout(() => {
       axajInd = 0