Commit 7331fd57 by 王岩

3.4.0+102相关内容

parent b1bdb390
#!/bin/sh
jq="./jq-win64.exe"
#日志输入
log() {
case $2 in
......@@ -41,28 +43,59 @@ get_current_branch() {
echo $branch
}
#通过账号获取token
getToken() {
token=($(curl -X POST "https://testapi.gzsle.com/auth/user/login" \
-H "Content-Type: application/json" \
-d '{"user_name":"wangyan", "password":"gzsle888", "login_type":2}'\
--compressed | awk -F'"authorization":"' '{print $2}' | awk -F '"},' '{print $1}'))
echo $token
}
#获取所有在线用户的userId
getUserId() {
# echo '{"name": "ACGKAKA"}' | $jq -r
data=($(curl -X GET "https://testapi.gzsle.com/auth/user/getAuthUsersList?page_size=1&page_no=1" \
-H "Content-Type: text/plain;charset=UTF-8" \
-H "Authorization: Bearer $1" \
--compressed))
echo $data | $jq -r
}
#发送消息通知
jPush() {
echo $(curl -s "https://api.jpush.cn/v3/push" \
-H "Authorization: Basic YjhiNjcyZmY3MjkyNjM1MTkzZjFhNjgwOmJmYWExYTg3YTEwZTNlMTJjNTI0ZmI0OQ==" \
-H "Content-Type: text/plain;charset=UTF-8" \
-d '{"platform":["android", "ios"],"audience":{"alias":["test_83916"]},"message":{"title":"Update","msg_content":"Update"}}' \
-d '{"platform":["android", "ios"],"audience":{"alias":["test_84192"]},"message":{"title":"Update","msg_content":"Update"}}' \
--compressed)
}
main() {
current_branch=$(get_current_branch)
DART_DEFINES=$(getToken)
getUserId $DART_DEFINES
# echo "获取的token为:$DART_DEFINES"
# current_branch=$(get_current_branch)
echo $current_branch
# echo $current_branch
if [[ "${current_branch}" == "test" ]]; then
jPush
else
echo "发送通知"
fi
# if [[ "${current_branch}" == "test" ]]; then
# jPush
# else
# echo "发送通知"
# fi
}
......
{
"android_version": "3.4.0+101",
"android_version": "3.4.0+102",
"android_forceUpdate": false,
"android_msg": "2.3.4相关内容",
"android_url": "https://gitlab.gzsle.com/wangyan/upgradeSFA/raw/test/app.apk",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment