king
2025-02-12 ed698a4ef051a13fe22c9ccfe121232c753725c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import React, { Component } from 'react'
import { Spin, notification } from 'antd'
 
import Api from '@/api'
 
import './index.scss'
 
class MkAi extends Component {
  state = {
    url: window.atob('aHR0cHM6Ly9jbG91$mkZC5tazloLmNu'.replace('$mk', '')) + '/webapi/dostars',
    loading: true,
    UserID: '',
    LoginUID: '',
    sql: ''
  }
 
  UNSAFE_componentWillMount() {
    if (sessionStorage.getItem('UserID')) {
      this.login()
    }
  }
 
  componentDidMount() {
    if (!sessionStorage.getItem('UserID')) {
      this.props.history.replace('/login')
      return
    }
  }
 
  login = () => {
    window.GLOB.transfer = false
    Api.getTouristMsg('cloud').then(res => {
      if (res.status) {
        this.setState({
          UserID: res.UserID,
          LoginUID: res.LoginUID,
          sql: sessionStorage.getItem('deepseek_sql') || ''
        }, () => {
          sessionStorage.removeItem('deepseek_sql')
          this.getList()
        })
      } else {
        sessionStorage.clear()
        this.props.history.replace('/login')
        window.location.reload()
      }
    })
  }
 
  getList = () => {
    const { UserID, LoginUID } = this.state
 
    Api.genericInterface({
      func: 's_get_deepseek_list',
      rduri: window.atob('aHR0cHM6Ly9jbG91$mkZC5tazloLmNu'.replace('$mk', '')) + '/webapi/dostars',
      userid: UserID,
      LoginUID: LoginUID,
      u_id: sessionStorage.getItem('UserID')
    }).then(result => {
      this.setState({loading: false})
 
      if (!result.status) {
        notification.error({
          top: 92,
          message: result.message,
          duration: 10
        })
      } else {
 
      }
    })
  }
 
  render () {
    const { loading } = this.state
 
    return (
      <div className="mk-deepseek-wrap">
        {loading ? <Spin size="large" /> : null}
      </div>
    )
  }
}
 
export default MkAi