1
This commit is contained in:
28
src/App.tsx
28
src/App.tsx
@@ -9,6 +9,7 @@ import toast, {Toaster} from "react-hot-toast";
|
||||
import wxShare from "@/wx/wxShare";
|
||||
import {enterpriseAnalyzeApi} from "@/api/service";
|
||||
import {useUserStore} from "@/store/user-store";
|
||||
import {uploadFileQoi} from "@/utils/upload/upload";
|
||||
|
||||
export default function App() {
|
||||
const userStore = useUserStore()
|
||||
@@ -27,18 +28,23 @@ export default function App() {
|
||||
* 上传文件
|
||||
*/
|
||||
const handleUpload = async (file) => {
|
||||
handleNextScreen()
|
||||
let res = await enterpriseAnalyzeApi({
|
||||
analys_image: file,
|
||||
analys_type: null,
|
||||
}) as any
|
||||
if (res.analysis_result.analyze_ret != "success") {
|
||||
toast.error("请重新上传结构清晰的组织架构图")
|
||||
setCurrentScreen(prev => prev = 2)
|
||||
return
|
||||
try {
|
||||
handleNextScreen()
|
||||
let fileUrl = await uploadFileQoi(file, "/analyze")
|
||||
let res = await enterpriseAnalyzeApi({
|
||||
analys_image: fileUrl,
|
||||
analys_type: null,
|
||||
}) as any
|
||||
if (res.analysis_result.analyze_ret != "success") {
|
||||
toast.error("请重新上传结构清晰的组织架构图")
|
||||
setCurrentScreen(prev => prev = 2)
|
||||
return
|
||||
}
|
||||
userStore.setAnalysis(res)
|
||||
handleNextScreen()
|
||||
} catch (e) {
|
||||
setCurrentScreen((prev => prev = 2))
|
||||
}
|
||||
userStore.setAnalysis(res)
|
||||
handleNextScreen()
|
||||
};
|
||||
|
||||
const handlePayment = () => {
|
||||
|
||||
Reference in New Issue
Block a user