This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
generated from Mister-Hope/miniapp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
162 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "pwa-chrome", | ||
"request": "launch", | ||
"name": "Launch Chrome against localhost", | ||
"url": "http://localhost:8080", | ||
"webRoot": "${workspaceFolder}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ App({ | |
globalData: ({ | ||
version, | ||
openid: "", | ||
foodlist: "", | ||
} as unknown) as GlobalData, | ||
|
||
onLaunch() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
require_once('./info/mysql.php'); | ||
require_once('./header/post-json.php'); | ||
require_once('./toBase64.php'); | ||
|
||
|
||
for ($i = 1; $i < 2; $i++) { | ||
$queryString = "SELECT src FROM food WHERE fid='$i'"; | ||
$searchResult = $mysqli->query($queryString); | ||
while ($row = mysqli_fetch_array($searchResult)) { | ||
$src = $row["src"]; | ||
} | ||
|
||
$newSrc = strlen(toBase64($src)) > 1000 ? toBase64($src) : $src; | ||
$queryString2 = "UPDATE food SET src = '$newSrc' WHERE fid='$i'"; | ||
$searchResult2 = $mysqli->query($queryString2); | ||
} | ||
|
||
$searchResult->free(); | ||
$mysqli->close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
require_once('./info/mysql.php'); | ||
require_once('./header/post-json.php'); | ||
|
||
for ($i = 800; $i < 900; $i++) { | ||
$queryString = "SELECT fid,src FROM food WHERE fid='$i'"; | ||
$searchResult = $mysqli->query($queryString); | ||
while ($row = mysqli_fetch_array($searchResult)) { | ||
$fid = $row["fid"]; | ||
$src = $row["src"]; | ||
|
||
} | ||
file_put_contents("./imageGroup/$fid.jpg", file_get_contents($src)); | ||
} | ||
|
||
$searchResult->free(); | ||
$mysqli->close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
header("Content-Type: text/json; charset=utf-8"); | ||
header('Access-Control-Allow-Origin:*'); | ||
header('Access-Control-Allow-Methods:POST'); | ||
header('Access-Control-Allow-Headers:x-requested-with,content-type'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
$servername = "localhost:3306"; | ||
$username = "nenu"; | ||
$password = "RLs864CBe8pdM3jt"; | ||
$dbname = "nenu"; | ||
// 创建连接 | ||
$mysqli = new mysqli($servername, $username, $password, $dbname); | ||
|
||
// 检测连接 | ||
if ($mysqli->connect_errno) { | ||
echo "Error" . $mysqli->connect_errno . " Failed to connect to MySQL: " . $mysqli->connect_error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
$appid = "1110071558"; | ||
$secret = "oKA9M0qS8RcDBnA4"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
$appid = "wxf4c24973a4322578"; | ||
$secret = "5be0103f9a10d11448b8a41c74c839ba"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
function curlGet($url) | ||
{ | ||
$curl = curl_init(); // 启动一个CURL会话 | ||
curl_setopt($curl, CURLOPT_URL, $url); | ||
curl_setopt($curl, CURLOPT_HEADER, 0); | ||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); | ||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查 | ||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查 SSL 加密算法是否存在 | ||
$tmpInfo = curl_exec($curl); //返回 api 的 json 对象 | ||
//关闭 URL 请求 | ||
curl_close($curl); | ||
return $tmpInfo; //返回 json 对象 | ||
} | ||
|
||
function curlPost($url, $data) | ||
{ | ||
$ch = curl_init(); | ||
$params[CURLOPT_URL] = $url; // 请求 url 地址 | ||
$params[CURLOPT_HEADER] = FALSE; // 是否返回响应头信息 | ||
$params[CURLOPT_SSL_VERIFYPEER] = false; | ||
$params[CURLOPT_SSL_VERIFYHOST] = false; | ||
$params[CURLOPT_RETURNTRANSFER] = true; // 是否将结果返回 | ||
$params[CURLOPT_POST] = true; | ||
$params[CURLOPT_POSTFIELDS] = $data; | ||
curl_setopt_array($ch, $params); // 传入 curl 参数 | ||
$p_rusult = curl_exec($ch); // 执行 | ||
curl_close($ch); // 关闭连接 | ||
return $p_rusult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters